James Hutchison <[email protected]> added the comment:
Yes and no, I can give you a single process single child example that just
shows that python 3.2 uses binary output while python 3.1 used system default
when piping, but trying to reproduce the multiprocessing output inconsistencies
would be... difficult. Unfortunately the software I used to spot the \n, \r\n
inconsistency with is proprietary. After creating a sample case in only python
I couldn't reproduce the inconsistent \r\n issue in python 3.2 so I cannot say
for certain that it wasn't caused by my C# program. I wouldn't worry about the
inconsistent endlines for now.
Note that I don't see in the "what's new" documentation it mentioning that 3.2
changed the behavior of piped output. Kind of a big deal.
Sample code to compare 3.1 and 3.2 piped output:
import sys;
import os;
import subprocess;
from time import sleep;
python31loc = r"C:\python31\python.exe";
python32loc = r"C:\python32\python.exe";
myname = "IOPipetest.py";
def main(args):
if(len(args) == 1):
# main code
print("Testing python 3.1 endlines.", end='\r\n');
output = subprocess.check_output("%s %s -output" % (python31loc,
myname));
print(output);
print("Testing python 3.2 endlines.", end='\r\n');
output = subprocess.check_output("%s %s -output" % (python32loc,
myname));
print(output);
sleep(7);
else:
for i in range(4):
print("TESTING DEFAULT"); # endline is supposed to be automatic
print("TESTING SLASH-EN\n", end='');
print("TESTING WINDOW-RETURN\r\n", end='');
if __name__ == "__main__":
main(sys.argv);
--------------------------------------
sample output:
Testing python 3.1 endlines.
b'TESTING DEFAULT\r\nTESTING SLASH-EN\r\nTESTING WINDOW-RETURN\r\r\nTESTING
DEFAULT\r\nTESTING SLASH-EN\r\nTESTING WINDOW-RETURN\r\r\nTESTING
DEFAULT\r\nTESTING SLASH-EN\r\nTESTING WINDOW-RETURN\r\r\nTESTING
DEFAULT\r\nTESTING SLASH-EN\r\nTESTING WINDOW-RETURN\r\r\n'
Testing python 3.2 endlines.
b'TESTING DEFAULT\nTESTING SLASH-EN\nTESTING WINDOW-RETURN\r\nTESTING
DEFAULT\nTESTING SLASH-EN\nTESTING WINDOW-RETURN\r\nTESTING DEFAULT\nTESTING
SLASH-EN\nTESTING WINDOW-RETURN\r\nTESTING DEFAULT\nTESTING SLASH-EN\nTESTING
WINDOW-RETURN\r\n'
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue11990>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com