Re: [stdlib-sig] argparse -- binary IO via standard streams

2012-06-05 Thread Michael Foord
On 5 Jun 2012, at 11:18, Moritz Klammler wrote: > Hello, > > in Python 3, this is a TypeError: > sys.stdout.write(b"hello, world\n") > > At the moment, argparse.FileType.__call__("-") unconditionally returns > sys.stdout even if mode is binary so writing binary data will fail if > the use

[stdlib-sig] argparse -- binary IO via standard streams

2012-06-05 Thread Moritz Klammler
Hello, in Python 3, this is a TypeError: >>> sys.stdout.write(b"hello, world\n") At the moment, argparse.FileType.__call__("-") unconditionally returns sys.stdout even if mode is binary so writing binary data will fail if the user selects to write it to stdout. I'm not sure if this is the best