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
b58ab2c6
Commit
b58ab2c6
authored
May 10, 2012
by
Jesus Cea
Browse files
Options
Browse Files
Download
Plain Diff
MERGE: Closes #14768: os.path.expanduser('~/a') doesn't works correctly when HOME is '/'
parents
3b1a74a9
7f0d8886
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
2 deletions
+6
-2
Lib/posixpath.py
Lib/posixpath.py
+2
-2
Lib/test/test_posixpath.py
Lib/test/test_posixpath.py
+1
-0
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/posixpath.py
View file @
b58ab2c6
...
...
@@ -266,8 +266,8 @@ def expanduser(path):
root
=
b'/'
else
:
root
=
'/'
userhome
=
userhome
.
rstrip
(
root
)
or
userhome
return
userhome
+
path
[
i
:]
userhome
=
userhome
.
rstrip
(
root
)
return
(
userhome
+
path
[
i
:])
or
root
# Expand paths containing shell variable substitutions.
...
...
Lib/test/test_posixpath.py
View file @
b58ab2c6
...
...
@@ -300,6 +300,7 @@ class PosixPathTest(unittest.TestCase):
with
support
.
EnvironmentVarGuard
()
as
env
:
env
[
'HOME'
]
=
'/'
self
.
assertEqual
(
posixpath
.
expanduser
(
"~"
),
"/"
)
self
.
assertEqual
(
posixpath
.
expanduser
(
"~/foo"
),
"/foo"
)
# expanduser should fall back to using the password database
del
env
[
'HOME'
]
home
=
pwd
.
getpwuid
(
os
.
getuid
()).
pw_dir
...
...
Misc/ACKS
View file @
b58ab2c6
...
...
@@ -335,6 +335,7 @@ Andrew Francis
Martin Franklin
Bruce Frederiksen
Robin Friedrich
Bradley Froehle
Ivan Frohne
Matthias Fuchs
Jim Fulton
...
...
Misc/NEWS
View file @
b58ab2c6
...
...
@@ -139,6 +139,8 @@ Library
-
Issue
#
13815
:
TarFile
.
extractfile
()
now
returns
io
.
BufferedReader
objects
.
-
Issue
#
14768
:
os
.
path
.
expanduser
(
'~/a'
)
doesn
't works correctly when HOME is '
/
'.
- Issue #14371: Support bzip2 in zipfile module. Patch by Serhiy Storchaka.
- Issue #13183: Fix pdb skipping frames after hitting a breakpoint and running
...
...
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