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

I rewrote Py_Main() to prepare the code to be able to implement my "-X dev" 
idea:
https://mail.python.org/pipermail/python-dev//2017-November/150514.html

The problem is that currently the code parsing command line options and the 
code setting the memory allocator (handle PYTHONMALLOC environment variable) 
are mixed, it's not possible to touch this code.

I had similar technical issues when trying to implement properly my PEP 540 
idea (Add a new UTF-8 mode): it's hard to change the Python filesystem encoding 
to UTF-8 after parsing command line arguments, since the current code to parse 
command line arguments already rely on the Python filesystem encoding and other 
parts of the Python runtime like the memory allocators.

If I implemented my PR correctly, it should become much more simpler to control 
PYTHONMALLOC and the filesystem encoding from the command line: from an -X 
option.

----------

_______________________________________
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