[issue29818] Py_SetStandardStreamEncoding leads to a memory error in debug mode

2019-05-14 Thread STINNER Victor
STINNER Victor added the comment: I fixed this issue in Python 3.7. Py_SetStandardStreamEncoding() now uses: PyMemAllocatorEx old_alloc; _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, _alloc); ... _PyMem_RawStrdup() ... PyMem_SetAllocator(PYMEM_DOMAIN_RAW, _alloc); --

[issue29818] Py_SetStandardStreamEncoding leads to a memory error in debug mode

2017-03-15 Thread Nick Coghlan
Changes by Nick Coghlan : -- versions: +Python 3.6, Python 3.7 ___ Python tracker ___ ___

[issue29818] Py_SetStandardStreamEncoding leads to a memory error in debug mode

2017-03-15 Thread Nick Coghlan
New submission from Nick Coghlan: For PEP 538, setting PYTHONIOENCODING turned out to have undesirable side effects on Python 2 instances in subprocesses, since Python 2 has no 'surrogateescape' error handler. So I switched to using the "Py_SetStandardStreamEncoding" API defined in