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
b20f905f
Commit
b20f905f
authored
Mar 25, 2015
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #23742: ntpath.expandvars() no longer loses unbalanced single quotes.
parents
764fc9bf
1b87ae0c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
1 deletion
+4
-1
Lib/ntpath.py
Lib/ntpath.py
+1
-1
Lib/test/test_ntpath.py
Lib/test/test_ntpath.py
+1
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/ntpath.py
View file @
b20f905f
...
...
@@ -386,7 +386,7 @@ def expandvars(path):
index
=
path
.
index
(
c
)
res
+=
c
+
path
[:
index
+
1
]
except
ValueError
:
res
+=
path
res
+=
c
+
path
index
=
pathlen
-
1
elif
c
==
percent
:
# variable or '%'
if
path
[
index
+
1
:
index
+
2
]
==
percent
:
...
...
Lib/test/test_ntpath.py
View file @
b20f905f
...
...
@@ -237,6 +237,7 @@ class TestNtpath(unittest.TestCase):
tester('
ntpath
.
expandvars
(
"%?bar%"
)
', "%?bar%")
tester('
ntpath
.
expandvars
(
"%foo%%bar"
)
', "bar%bar")
tester('
ntpath
.
expandvars
(
"
\
'
%foo%
\
'
%bar"
)
', "
\
'
%foo%
\
'
%bar")
tester('
ntpath
.
expandvars
(
"bar
\
'
%foo%"
)
', "bar
\
'
%foo%")
@unittest.skipUnless(support.FS_NONASCII, '
need
support
.
FS_NONASCII
')
def test_expandvars_nonascii(self):
...
...
Misc/NEWS
View file @
b20f905f
...
...
@@ -30,6 +30,8 @@ Core and Builtins
Library
-------
-
Issue
#
23742
:
ntpath
.
expandvars
()
no
longer
loses
unbalanced
single
quotes
.
-
Issue
#
21717
:
The
zipfile
.
ZipFile
.
open
function
now
supports
'x'
(
exclusive
creation
)
mode
.
...
...
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