This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author keviv
Recipients keviv
Date 2014-11-16.14:58:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1416149886.65.0.378402881729.issue22884@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-11-16 14:58:06kevivsetrecipients: + keviv
2014-11-16 14:58:06kevivsetmessageid: <1416149886.65.0.378402881729.issue22884@psf.upfronthosting.co.za>
2014-11-16 14:58:06kevivlinkissue22884 messages
2014-11-16 14:58:06kevivcreate