STINNER Victor <victor.stin...@gmail.com> added the comment:

Summary of the visible changes:

* sys.argv is now set earlier, before "import site"

* The implementation of the PEP 538 now respects -E and -I options.

* _PyCoreConfig now allows to modify a lot of configuration options which 
wasn't possible to configure previously. (_PyMainInterpreterConfig allows to 
configure options using Python types.) It should be very useful for embedded 
Python, once the API will be public.


Summary of the most important changes:

* On Unix, char **argv of main() is now decoded again and the configuration 
(cmdline, env vars, etc.) is read again if the C locale is coerced (PEP 538) or 
if the UTF-8 Mode is enabled (PEP 540).

* The "path configuration" (sys.path, sys.prefix, sys.exec_prefix, etc.) is now 
computed before _Py_InitializeMainInterpreter(), by 
_PyMainInterpreterConfig_Read()

* Warning options are now computed in a list from -W options and PYTHONWARNINGS 
env var, before setting sys.warnoptions. Similar change has been done for 
sys._xoptions: xoptions are first stored in a wchar_t** list.

* A new _PyInitError structure has been introduced to be able to report 
failures instead of calling Py_FatalError(). Most of the Python initializatioin 
code has been modified to use it.

* Py_Main() now only uses regular C functions (using wchar_t* type for example) 
before _Py_InitializeCore(), the Python C API is now only used after 
_Py_InitializeCore().

* A new _PyCoreConfig_Read() has been added to read most configuration options 
using C types. _PyMainInterpreterConfig_Read() is now mostly responsible to 
convert C types to Python types.

* It becomes simpler to decide the priority between env vars, -X options, 
command line options, Py_xxx global variables, etc. The code to read these 
options and to code to "merge" these options is now decoupled.

* Each interpreter now has its copy of the "core_config" (_PyCoreConfig) and 
the main "config" (_PyMainInterpreterConfig). When using multiple interpreters, 
it is important to get Python objects created with the right interpreter for 
the main config. The ownership of these configurations becomes more obvious.

* Many global buffers with a fixed size like "static wchar_t 
progpath[MAXPATHLEN+1];" in Modules/getpath.c have been replaced with memory 
allocated on the heap with functions to release memory.

* Python/pathconfig.c (360 lines) has been added. More code is shared between 
Windows and Unix to compute the module search path (sys.path).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32030>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to