Kevin Orr added the comment:
Hmm, not sure why I thought I needed `inline code formatting`. It's all
monospace anyway!
Anyway, I'm thinking that adding this somewhere in argparse.py:
class _WrappedIO(object):
def __init__(self, fileobj):
self._file = fileobj
def _
New submission from Kevin Orr:
When one uses a file object returned by `FileType.__call__` as a context
manager, `sys.stdin`'s or `sys.stdout`'s `__exit__` will be triggered upon exit
of the context, in turn calling their `close` method.
Perhaps the issue is that `sys.stdin` and `