This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients barry, eric.snow, ncoghlan, ned.deily, serhiy.storchaka, vstinner
Date 2018-01-24.16:32:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I made most, if not all, changes that I wanted to do. It's time to close this huge issue to continue the work in new more specific issues.

Notes on Py_Main().

(*) _PyPathConfig_Init() is called even if it's not needed (if all "Path configuration outputs" fileds of PyCoreConfig are filled).

(*) pymain_cmdline() uses _Py_CommandLineDetails structure which contains a copy of each global configuration variable like Py_UTF8Mode. Internally, the function has to "set" or "get" these variables when calling some functions like _PyPathConfig_Init().

This code is fragile. *But* pymain_read_conf() is complex, it had to read again the whole configuration a second time if the encoding changed.

It would be nice to remove global variables from _Py_CommandLineDetails to avoid the get/set dance which introduces a risk of loosing changes by mistake. But I'm not sure that it's doable?

(*) Should we make Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors configurable in _PyCoreConfig? Same question for _Py_StandardStreamEncoding, _Py_StandardStreamErrors and PYTHONIOENCODING environment variable.
Date User Action Args
2018-01-24 16:32:24vstinnersetrecipients: + vstinner, barry, ncoghlan, ned.deily, eric.snow, serhiy.storchaka
2018-01-24 16:32:24vstinnersetmessageid: <>
2018-01-24 16:32:24vstinnerlinkissue32030 messages
2018-01-24 16:32:24vstinnercreate