Hi all,
I have a problem need your help.
Thanks in advance.
1. Context:
I customized source code CPython 3.9.6 (https://www.python.org/downloads/release/python-396/)
In detailed, instead of reading directories from config, i fixed some directories sys._base_executable = '/', sys.base_prefix = '/mfp', sys.base_exec_prefix = '/mfpsys',...
2. Problem
I run into a problem when run script Python. I got the following log
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/'
sys.base_prefix = '/mfpsys'
sys.base_exec_prefix = '/mfpsys'
sys.platlibdir = 'lib'
sys.executable = '/'
sys.prefix = '/mfpsys'
sys.exec_prefix = '/mfpsys'
sys.path = [
'/site-packages',
'/mfpsys/lib/python3.9',
'/mfpsys/lib/python3.9/lib-dynload',
'/mfpsys/lib/python3.9/site-packages',
]
LookupError: no codec search functions registered: can't find encoding
I have investigated in source code Python 3.9.6, found the related source code show above error log.
\Python-3.9\Python\codecs.c
PyObject* _PyCodec_Lookup(const char* encoding)
{
...
const Py_ssize_t len = PyList_Size(interp->codec_search_path);
if (len == 0) {
PyErr_SetString(PyExc_LookupError,
"no codec search functions registered: "
"can't find encoding");
goto onError;
}
...
}
I have no idea to this problem. Please give me your kind suggestion.
I have a problem need your help.
Thanks in advance.
1. Context:
I customized source code CPython 3.9.6 (https://www.python.org/downloads/release/python-396/)
In detailed, instead of reading directories from config, i fixed some directories sys._base_executable = '/', sys.base_prefix = '/mfp', sys.base_exec_prefix = '/mfpsys',...
2. Problem
I run into a problem when run script Python. I got the following log
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/'
sys.base_prefix = '/mfpsys'
sys.base_exec_prefix = '/mfpsys'
sys.platlibdir = 'lib'
sys.executable = '/'
sys.prefix = '/mfpsys'
sys.exec_prefix = '/mfpsys'
sys.path = [
'/site-packages',
'/mfpsys/lib/python3.9',
'/mfpsys/lib/python3.9/lib-dynload',
'/mfpsys/lib/python3.9/site-packages',
]
LookupError: no codec search functions registered: can't find encoding
I have investigated in source code Python 3.9.6, found the related source code show above error log.
\Python-3.9\Python\codecs.c
PyObject* _PyCodec_Lookup(const char* encoding)
{
...
const Py_ssize_t len = PyList_Size(interp->codec_search_path);
if (len == 0) {
PyErr_SetString(PyExc_LookupError,
"no codec search functions registered: "
"can't find encoding");
goto onError;
}
...
}
I have no idea to this problem. Please give me your kind suggestion.