[issue10728] argparse.ArgumentParser.print_help uses sys.stdout

2010-12-17 Thread Silvio Ricardo Cordeiro
New submission from Silvio Ricardo Cordeiro silvioricar...@gmail.com: The documentation at http://docs.python.org/dev/library/argparse.html explicitly says that If file is None, sys.stderr is assumed. However, both print_usage and print_help assume sys.stdout when file=None. The helper method

[issue1539381] Add readinto method to StringIO and cStringIO

2014-11-03 Thread Silvio Ricardo Cordeiro
Silvio Ricardo Cordeiro added the comment: BufferedReader assumes that readinto is defined, but that's not the case for StringIO's. In the end, this cripples StringIO objects, because their data can never be peek()'ed as with all other file objects. -- components: +IO -Library (Lib

[issue29396] Re-opening /dev/tty breaks readline

2017-01-31 Thread Silvio Ricardo Cordeiro
New submission from Silvio Ricardo Cordeiro: The following code works on python2 (tested with 2.7.6), but breaks readline for python3 (tested with 3.4.3): >>> import sys, readline >>> sys.stdin = open('/dev/tty', 'r') >>> input("> ") # press "7&q

[issue29396] Re-opening /dev/tty breaks readline

2017-09-07 Thread Silvio Ricardo Cordeiro
Silvio Ricardo Cordeiro added the comment: So, if I understood correctly, the `readline` module only works for an unmodified `sys.stdin`, which is implemented in terms of C `FILE*` structures. Anything created by `open` will not be implemented in terms of C `FILE*`, and so all history