Message231874
| 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: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 |
|