[issue22884] argparse.FileType.__call__ returns unwrapped sys.stdin and stdout

2014-11-16 Thread Kevin Orr
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 _

[issue22884] argparse.FileType.__call__ returns unwrapped sys.stdin and stdout

2014-11-16 Thread Kevin Orr
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 `