[issue10931] print() from pipe enclosed between 'b and 'pair on python3
New submission from ricardw rica...@intervisit.com: The following script produces different output on python2.6.6 vs. python3.1.2: - import subprocess, sys ls = subprocess.Popen(['ls', '-l', '/etc/motd'], stdout=subprocess.PIPE,) end_of_pipe = ls.stdout print('Result:') for line in end_of_pipe: print(line.strip()) - Result from invoking with python2 and python3 are respectively: Result: -rw-rw 1 root root 25 Jan 18 10:25 /etc/motd and: Result: b'-rw-rw 1 root root 25 Jan 18 10:25 /etc/motd' Is this difference a feature, or a bug ? -- components: Interpreter Core messages: 126457 nosy: ricardw priority: normal severity: normal status: open title: print() from pipe enclosed between 'b and 'pair on python3 type: behavior versions: Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10931 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10931] print() from pipe enclosed between b' and 'pair on python3
Changes by ricardw rica...@intervisit.com: -- title: print() from pipe enclosed between 'b and 'pair on python3 - print() from pipe enclosed between b' and 'pair on python3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10931 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10931] print() from pipe enclosed between {b'} and {'}-pair on python3
Changes by ricardw rica...@intervisit.com: -- title: print() from pipe enclosed between b' and 'nbsp;pair on python3 - print() from pipe enclosed between {b'} and {'}-pair on python3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10931 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10931] print() from pipe enclosed between {b'} and {'}-pair on python3
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: It's a feature. Subprocess output is binary data, not text; and since python3, the string type is now what python2 called unicode! Please read http://docs.python.org/py3k/whatsnew/3.0.html#text-vs-data-instead-of-unicode-vs-8-bit for an explanation of the most important difference between python2 and python3. -- nosy: +amaury.forgeotdarc resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10931 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com