[issue16587] Py_Initialize breaks wprintf on Windows

STINNER Victor report at bugs.python.org
Mon Dec 3 08:23:52 CET 2012


STINNER Victor added the comment:

_setmode(self->fd, O_BINARY) change was done in Python 3.2: see the issue #10841. This change introduced regressions:

 - #11272: "input() has trailing carriage return on windows", fixed in Python 3.2.1
 - #11395: "print(s) fails on Windows with long strings", fixed in Python 3.2.1
 - #13119: "Newline for print() is \n on Windows, and not \r\n as expected", fixed in Python 3.3 (and will be fixed in Python 3.2.4)

In Python 3.1, _setmode(self->fd, O_BINARY) was already used when Python is called with the -u command line option.

_setmode() supports different options:

 - _O_BINARY: no conversion
 - _O_TEXT: translate "\n" with "\r\n"
 - _O_U8TEXT: UTF-8 without BOM
 - _O_U16TEXT: UTF-16 without BOM
 - _O_WTEXT: UTF-16 with BOM

I didn't try wprintf(). This function is not used in the Python source code (except in the Windows launcher, which is not part of the main interpreter).

I don't know how to fix wprintf().

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16587>
_______________________________________


More information about the Python-bugs-list mailing list