Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
056c31f9
Commit
056c31f9
authored
Jul 21, 2012
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#12353: argparse now correctly handles null argument values.
Patch by Torsten Landschoff.
parent
1a2c1fbf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
1 deletion
+4
-1
Lib/argparse.py
Lib/argparse.py
+1
-1
Lib/test/test_argparse.py
Lib/test/test_argparse.py
+1
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/argparse.py
View file @
056c31f9
...
...
@@ -1967,7 +1967,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
for
arg_string
in
arg_strings
:
# for regular arguments, just add them back into the list
if
arg_string
[
0
]
not
in
self
.
fromfile_prefix_chars
:
if
not
arg_string
or
arg_string
[
0
]
not
in
self
.
fromfile_prefix_chars
:
new_arg_strings
.
append
(
arg_string
)
# replace arguments referencing files with the file content
...
...
Lib/test/test_argparse.py
View file @
056c31f9
...
...
@@ -1374,6 +1374,7 @@ class TestArgumentsFromFile(TempDirMixin, ParserTestCase):
(
'X @hello'
,
NS
(
a
=
None
,
x
=
'X'
,
y
=
[
'hello world!'
])),
(
'-a B @recursive Y Z'
,
NS
(
a
=
'A'
,
x
=
'hello world!'
,
y
=
[
'Y'
,
'Z'
])),
(
'X @recursive Z -a B'
,
NS
(
a
=
'B'
,
x
=
'X'
,
y
=
[
'hello world!'
,
'Z'
])),
([
"-a"
,
""
,
"X"
,
"Y"
],
NS
(
a
=
''
,
x
=
'X'
,
y
=
[
'Y'
])),
]
...
...
Misc/NEWS
View file @
056c31f9
...
...
@@ -90,6 +90,8 @@ Core and Builtins
Library
-------
- Issue #12353: argparse now correctly handles null argument values.
- Issue #6493: An issue in ctypes on Windows that caused structure bitfields
of type ctypes.c_uint32 and width 32 to incorrectly be set has been fixed.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment