Skip to content

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Apr 3, 2024

They are now supported in bytes paths as well as in string paths.

…anduser()

They are now supported in bytes paths as well as in string paths.
@serhiy-storchaka serhiy-storchaka merged commit 51132da into python:main Apr 17, 2024
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@serhiy-storchaka serhiy-storchaka deleted the posixpath-expanduser branch April 17, 2024 09:53
@miss-islington-app
Copy link

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 51132da0c4dac13500d9bb86b2fdad42091d3fd9 3.12

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Apr 17, 2024
…ath.expanduser() (pythonGH-117504)

They are now supported in bytes paths as well as in string paths.
(cherry picked from commit 51132da)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Apr 17, 2024

GH-117970 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Apr 17, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…anduser() (pythonGH-117504)

They are now supported in bytes paths as well as in string paths.
serhiy-storchaka added a commit that referenced this pull request Apr 17, 2024
…panduser() (GH-117504) (GH-117970)

They are now supported in bytes paths as well as in string paths.
(cherry picked from commit 51132da)
@kulikjak
Copy link
Contributor

Hi @serhiy-storchaka - the newly added test fails when there are users with a trailing slash in their home path (which I think is allowed?):

======================================================================
FAIL: test_expanduser_pwd2 (test.test_posixpath.PosixPathTest.test_expanduser_pwd2)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/.../cpython-3.12/Lib/test/test_posixpath.py", line 344, in test_expanduser_pwd2
    self.assertEqual(posixpath.expanduser('~' + name), home)
AssertionError: '/home/foo' != '/home/foo/'

@serhiy-storchaka
Copy link
Member Author

Good catch @kulikjak! Will be fixed in #118056.

@kulikjak
Copy link
Contributor

Thank you for the fix - the issue is gone now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants