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
2ad5421d
Commit
2ad5421d
authored
Aug 31, 2014
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't index outside of the path (closes #22312)
parent
3f48d394
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 @
2ad5421d
...
...
@@ -113,7 +113,7 @@ def splitdrive(p):
"""
if
len
(
p
)
>
1
:
normp
=
p
.
replace
(
altsep
,
sep
)
if
(
normp
[
0
:
2
]
==
sep
*
2
)
and
(
normp
[
2
]
!=
sep
):
if
(
normp
[
0
:
2
]
==
sep
*
2
)
and
(
normp
[
2
:
3
]
!=
sep
):
# is a UNC path:
# vvvvvvvvvvvvvvvvvvvv drive letter or UNC path
# \\machine\mountpoint\directory\etc\...
...
...
Lib/test/test_ntpath.py
View file @
2ad5421d
...
...
@@ -50,6 +50,7 @@ class TestNtpath(unittest.TestCase):
# Issue #19911: UNC part containing U+0130
self
.
assertEqual
(
ntpath
.
splitdrive
(
u'//conky/MOUNTPOİNT/foo/bar'
),
(
u'//conky/MOUNTPOİNT'
,
'/foo/bar'
))
self
.
assertEqual
(
ntpath
.
splitdrive
(
"//"
),
(
""
,
"//"
))
def
test_splitunc
(
self
):
tester
(
'ntpath.splitunc("c:
\
\
foo
\
\
bar")'
,
...
...
Misc/NEWS
View file @
2ad5421d
...
...
@@ -19,6 +19,8 @@ Core and Builtins
Library
-------
- Issue #22312: Fix ntpath.splitdrive IndexError.
- Issue #22216: smtplib now resets its state more completely after a quit. The
most obvious consequence of the previous behavior was a STARTTLS failure
during a connect/starttls/quit/connect/starttls sequence.
...
...
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