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
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
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
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