[issue13824] argparse.FileType opens a file and never closes it

2012-02-03 Thread David Layton
David Layton added the comment: Eric, checked that the file exists But then you’d run into race conditions. The only sure was to say if a file can be opened is to open it. I think you misunderstand me. I am NOT suggesting that you open and close the file. I am saying that you should not

[issue13824] argparse.FileType opens a file without excepting resposibility for closing it

2012-01-19 Thread David Layton
New submission from David Layton : argparse.FileType.__call__ opens the specified file and returns it. This is well documented as an anit-idiom in http://docs.python.org/howto/doanddont.html#exceptions. "...a serious problem — due to implementation details in CPython, the file would n