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 mitar
Recipients David.Layton, Paolo.Elvati, Stefan.Pfeiffer, bethard, eric.araujo, manveru, mitar, paul.j3
Date 2019-05-07.02:51:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1557197460.73.0.863734084016.issue13824@roundup.psfhosted.org>
In-reply-to
Content
Why not make FileType instance also a context manager, so you could do something like:

with arguments.input as f:
   assert arguments.input is f

For backwards compatibility, FileType would open eagerly as now, but it would be closed at exit from context manager.

We should just make sure we do not close stdout/stderr.
History
Date User Action Args
2019-05-07 02:51:00mitarsetrecipients: + mitar, bethard, eric.araujo, Paolo.Elvati, manveru, Stefan.Pfeiffer, paul.j3, David.Layton
2019-05-07 02:51:00mitarsetmessageid: <1557197460.73.0.863734084016.issue13824@roundup.psfhosted.org>
2019-05-07 02:51:00mitarlinkissue13824 messages
2019-05-07 02:51:00mitarcreate