Message231249
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 `sys.stdout` have poor `__exit__` methods, but my proposal (and it's not a particularly clean one) is to override the file object's `__exit__` if it happens to be either `sys.stdin` or `sys.stdout` to simply return True when called. |
|
Date |
User |
Action |
Args |
2014-11-16 14:58:06 | keviv | set | recipients:
+ keviv |
2014-11-16 14:58:06 | keviv | set | messageid: <1416149886.65.0.378402881729.issue22884@psf.upfronthosting.co.za> |
2014-11-16 14:58:06 | keviv | link | issue22884 messages |
2014-11-16 14:58:06 | keviv | create | |
|