Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(332)

Issue 3251041: argparse FileType raises ugly exception for missing file

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 2 months ago by akira
Modified:
11 years, 1 month ago
Reviewers:
michael.mischurow, merwok
CC:
akira
Base URL:
http://svn.python.org/projects/python/branches/py3k/
Visibility:
Public.

Patch Set 1 #

Patch Set 2 : added tests for readonly files; raise ValueError in FileType.__call__ #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -8 lines) Patch
M Lib/argparse.py View 1 2 chunks +11 lines, -6 lines 3 comments Download
M Lib/test/test_argparse.py View 1 3 chunks +16 lines, -2 lines 4 comments Download

Messages

Total messages: 3
merwok
Some comments about style. I don’t know the argparse test machinery very well, but the ...
11 years, 1 month ago (2010-11-25 11:28:05 UTC) #1
SilentGhost
http://codereview.appspot.com/3251041/diff/2001/Lib/argparse.py File Lib/argparse.py (right): http://codereview.appspot.com/3251041/diff/2001/Lib/argparse.py#newcode1134 Lib/argparse.py:1134: err = _sys.exc_info()[1] On 2010/11/25 11:28:06, merwok wrote: > ...
11 years, 1 month ago (2010-11-25 11:52:32 UTC) #2
SilentGhost
11 years, 1 month ago (2010-11-25 13:46:37 UTC) #3
updated patch attached to bug http://bugs.python.org/issue9509

http://codereview.appspot.com/3251041/diff/2001/Lib/test/test_argparse.py
File Lib/test/test_argparse.py (right):

http://codereview.appspot.com/3251041/diff/2001/Lib/test/test_argparse.py#new...
Lib/test/test_argparse.py:58: file = open(file_path, 'w')
On 2010/11/25 11:28:06, merwok wrote:
> Please use a with statement.

Done.

http://codereview.appspot.com/3251041/diff/2001/Lib/test/test_argparse.py#new...
Lib/test/test_argparse.py:61: import stat
On 2010/11/25 11:28:06, merwok wrote:
> Please avoid imports at the function level.

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b