[issue18512] sys.stdout.write does not allow bytes in Python 3.x

2013-10-13 Thread Georg Brandl
Changes by Georg Brandl : -- resolution: -> wont fix status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue18512] sys.stdout.write does not allow bytes in Python 3.x

2013-10-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue18512] sys.stdout.write does not allow bytes in Python 3.x

2013-08-20 Thread Ezio Melotti
Ezio Melotti added the comment: > A workaround is to perform sys.stdout.flush() before > sys.stdout.buffer.write(). FWIW you can just use print(..., flush=True) from 3.3+. -- ___ Python tracker __

[issue18512] sys.stdout.write does not allow bytes in Python 3.x

2013-08-18 Thread Juan Luis Boya García
Juan Luis Boya García added the comment: Sorry for the late response, GMail's SPAM filter ate the replies. The main issue is sys.stdout being opened as text instead of binary. This fact is stated in the docs. http://docs.python.org/3/library/sys.html#sys.stdout In any case, there are some cave

[issue18512] sys.stdout.write does not allow bytes in Python 3.x

2013-08-10 Thread Ezio Melotti
Ezio Melotti added the comment: > You can do >sys.stdout.buffer.write(b"hello") Note that this might not work when sys.stdout has been replaced with something else (e.g. a StringIO). -- nosy: +ezio.melotti ___ Python tracker

[issue18512] sys.stdout.write does not allow bytes in Python 3.x

2013-07-23 Thread Martin v . Löwis
Martin v. Löwis added the comment: Rephrasing R.David's question: ntrrgc: Did you consult any documentation (browsing or searching), and if so, where did you look? -- nosy: +loewis ___ Python tracker ___

[issue18512] sys.stdout.write does not allow bytes in Python 3.x

2013-07-20 Thread R. David Murray
R. David Murray added the comment: The fundamental behavior here is not going to change, as maintaining a bright line between bytes and strings is central to Python3's design. The question is, does the method for achieving your goal need better documentation? -- assignee: -> docs@pyt

[issue18512] sys.stdout.write does not allow bytes in Python 3.x

2013-07-20 Thread Richard Oudkerk
Richard Oudkerk added the comment: You can do sys.stdout.buffer.write(b"hello") See http://docs.python.org/dev/library/io.html?highlight=buffer#io.TextIOBase.buffer -- nosy: +sbt ___ Python tracker

[issue18512] sys.stdout.write does not allow bytes in Python 3.x

2013-07-19 Thread Juan Luis Boya García
New submission from Juan Luis Boya García: Sometimes developers need to write text to stdout, and it's nice to have on the fly Unicode to UTF-8 conversion (or what matches the platform), but sometimes they also need to output binary blobs, like text encoded in other codifications than the syst