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
d03b7757
Commit
d03b7757
authored
Oct 25, 2018
by
Tim Graham
Committed by
Steve Dower
Oct 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-31047: Fix ntpath.abspath to trim ending separator (GH-10082)
Regression in b0bf51b32240369ccb736dc32ff82bb96f375402.
parent
e25d5fc1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletion
+5
-1
Lib/ntpath.py
Lib/ntpath.py
+1
-1
Lib/test/test_ntpath.py
Lib/test/test_ntpath.py
+2
-0
Misc/NEWS.d/next/Library/2018-10-25-09-37-03.bpo-31047.kBbX8r.rst
...S.d/next/Library/2018-10-25-09-37-03.bpo-31047.kBbX8r.rst
+2
-0
No files found.
Lib/ntpath.py
View file @
d03b7757
...
@@ -523,7 +523,7 @@ else: # use native Windows method on Windows
...
@@ -523,7 +523,7 @@ else: # use native Windows method on Windows
def
abspath
(
path
):
def
abspath
(
path
):
"""Return the absolute version of a path."""
"""Return the absolute version of a path."""
try
:
try
:
return
_getfullpathname
(
path
)
return
normpath
(
_getfullpathname
(
path
)
)
except
(
OSError
,
ValueError
):
except
(
OSError
,
ValueError
):
return
_abspath_fallback
(
path
)
return
_abspath_fallback
(
path
)
...
...
Lib/test/test_ntpath.py
View file @
d03b7757
...
@@ -284,6 +284,8 @@ class TestNtpath(unittest.TestCase):
...
@@ -284,6 +284,8 @@ class TestNtpath(unittest.TestCase):
tester('
ntpath
.
abspath
(
""
)
', cwd_dir)
tester('
ntpath
.
abspath
(
""
)
', cwd_dir)
tester('
ntpath
.
abspath
(
" "
)
', cwd_dir + "
\
\
")
tester('
ntpath
.
abspath
(
" "
)
', cwd_dir + "
\
\
")
tester('
ntpath
.
abspath
(
"?"
)
', cwd_dir + "
\
\
?")
tester('
ntpath
.
abspath
(
"?"
)
', cwd_dir + "
\
\
?")
drive, _ = ntpath.splitdrive(cwd_dir)
tester('
ntpath
.
abspath
(
"/abc/"
)
', drive + "
\
\
abc")
def test_relpath(self):
def test_relpath(self):
tester('
ntpath
.
relpath
(
"a"
)
', '
a
')
tester('
ntpath
.
relpath
(
"a"
)
', '
a
')
...
...
Misc/NEWS.d/next/Library/2018-10-25-09-37-03.bpo-31047.kBbX8r.rst
0 → 100644
View file @
d03b7757
Fix ``ntpath.abspath`` regression where it didn't remove a trailing
separator on Windows. Patch by Tim Graham.
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