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 v+python
Recipients v+python
Date 2011-01-06.02:11:53
SpamBayes Score 4.9404925e-14
Marked as misclassified No
Message-id <>
Per Antoine's request, I wrote this test code, it isn't elegant, I whipped it together quickly; but it shows the issue.  The issue may be one of my ignorance, but it does show the behavior I described in issue 4953. Here's the output from the various test parameters that might be useful in running the test.

>c:\python32\python.exe test 1
['c:\\python32\\python.exe', '', '1']
All OK

>c:\python32\python.exe test 2
['c:\\python32\\python.exe', '', '2']
Not OK: b'abc\r\r\ndef\r\r\n'

>c:\python32\python.exe test 3
['c:\\python32\\python.exe', '', '3']
All OK

>c:\python32\python.exe test 4
['c:\\python32\\python.exe', '', '4']
Not OK: b'abc\r\r\ndef\r\r\n'

>c:\python32\python.exe test 1-u
['c:\\python32\\python.exe', '-u', '', '1-u']
All OK

>c:\python32\python.exe test 2-u
['c:\\python32\\python.exe', '-u', '', '2-u']
All OK

>c:\python32\python.exe test 3-u
['c:\\python32\\python.exe', '-u', '', '3-u']
All OK

>c:\python32\python.exe test 4-u
['c:\\python32\\python.exe', '-u', '', '4-u']
All OK


Note that test 2 and 4, which do not use the mscvrt stuff, have double \r: one sent by the code, and another added, apparently by MSC newline processing.  test 2-u and 4-u, which are invoking the subprocess with Python's -u parameter, also do not exhibit the problem, even though the mscvrt stuff is not used.  This seems to indicate that Python's -u parameter does approximately the same thing as my windows_binary function.

Seems like if Python already has code for this, that it would be nice to either make it more easily available to the user as an API (like my windows_binary function, invoked with a single line) in the io or sys modules (since it is used to affect sys.std* files).

And it would be nice if the function "worked cross-platform", even if it is a noop on most platforms.
Date User Action Args
2011-01-06 02:11:57v+pythonsetrecipients: + v+python
2011-01-06 02:11:57v+pythonsetmessageid: <>
2011-01-06 02:11:53v+pythonlinkissue10841 messages
2011-01-06 02:11:53v+pythoncreate