Message310612
| 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 |
<1516811544.18.0.467229070634.issue32030@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|