[issue4571] write to stdout in binary mode - is it possible?

jeff deifik report at bugs.python.org
Sun Dec 7 16:49:01 CET 2008


jeff deifik <jeff at jeffunit.com> added the comment:

I don't consider sys.stdout.buffer.write(b'abc')
to be an acceptable solution. There are many programs that need
to produce binary output with standard output. Consider uudecode
and similar programs.

There needs to be a standard, portable, documented way to put stdout
into binary mode in order to write binary output. For example,
all the flavors of the print command need to be able to send binary
data to standard output.

I don't have a problem changing open statements to support binary
file i/o, but I do have a problem changing every print or write statement
in order to support binary file i/o.

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


More information about the Python-bugs-list mailing list