Message231874
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. |
|
Date |
User |
Action |
Args |
2014-11-30 01:20:35 | paul.j3 | set | recipients:
+ paul.j3, r.david.murray, keviv |
2014-11-30 01:20:34 | paul.j3 | set | messageid: <1417310434.85.0.609118540979.issue22884@psf.upfronthosting.co.za> |
2014-11-30 01:20:34 | paul.j3 | link | issue22884 messages |
2014-11-30 01:20:33 | paul.j3 | create | |
|