mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
gh-117503: Fix support of non-ASCII user names in posixpath.expanduser() (GH-117504)
They are now supported in bytes paths as well as in string paths.
This commit is contained in:
parent
44890b209e
commit
51132da0c4
3 changed files with 14 additions and 1 deletions
|
|
@ -262,7 +262,7 @@ def expanduser(path):
|
|||
return path
|
||||
name = path[1:i]
|
||||
if isinstance(name, bytes):
|
||||
name = name.decode('ascii')
|
||||
name = os.fsdecode(name)
|
||||
try:
|
||||
pwent = pwd.getpwnam(name)
|
||||
except KeyError:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue