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 paul.j3
Recipients keviv, paul.j3, r.david.murray
Date 2014-11-30.01:20:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1417310434.85.0.609118540979.issue22884@psf.upfronthosting.co.za>
In-reply-to
Content
Related issues are:

http://bugs.python.org/issue13824 - argparse.FileType opens a file and never closes it
http://bugs.python.org/issue14156 - argparse.FileType for '-' doesn't work for a mode of 'rb'

As discussed earlier FileType was meant as a convenience for small scripting applications, ones that don't try to close the file before exiting.

But now we are encouraged to open files in a context that guarantees closure.  In 13824 I proposed a 'FileContext', and included a dummy context like this handle stdin/out.

But I think the closefd=False approach raised in 14156 and David is probably the better way to go.

I think the main thing that is lacking is a testing mechanism.
History
Date User Action Args
2014-11-30 01:20:35paul.j3setrecipients: + paul.j3, r.david.murray, keviv
2014-11-30 01:20:34paul.j3setmessageid: <1417310434.85.0.609118540979.issue22884@psf.upfronthosting.co.za>
2014-11-30 01:20:34paul.j3linkissue22884 messages
2014-11-30 01:20:33paul.j3create