This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: pathlib.resolve and .absolute leave trailing tilde in home expansion
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Infrasonics, andybergon, eryksun
Priority: normal Keywords:

Created on 2019-09-21 22:01 by Infrasonics, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg352954 - (view) Author: (Infrasonics) Date: 2019-09-21 22:01
`Path('~').resolve()` gives `PosixPath('/home/youruser/~')`.
Same problem for `.absolute`, yet `.expanduser` works correctly.
msg352957 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2019-09-22 01:48
Only Path.expanduser() special cases tilde as a POSIX shell would. Otherwise "~" is not a reserved filename character in POSIX. Path('~') is a file named "~" that's relative to the current working directory. By coincidence the working directory is the user's home directory in your example.
History
Date User Action Args
2022-04-11 14:59:20adminsetgithub: 82427
2020-03-27 04:52:15andybergonsetnosy: + andybergon
2019-09-22 01:48:57eryksunsetstatus: open -> closed

nosy: + eryksun
messages: + msg352957

resolution: not a bug
stage: resolved
2019-09-21 22:01:21Infrasonicscreate