Message416488
> Now a file that doesn't exist:
> >>> mike = Path("palin.jpg")
> >>> mike.resolve()
> WindowsPath('palin.jpg')
This is a bug in resolve(). It was fixed in 3.10+ by switching to ntpath.realpath(). I don't remember why a fix for 3.9 was never applied. Work on the PR may have stalled due to a minor disagreement.
> 'C:\Windows\..\Program Files' and '/usr/../bin' == relative path
No, a relative path depends on either the current working directory or, for a symlink target, the path of the directory that contains the symlink.
In Windows, a rooted path such as r"\spam" is a relative path because it depends on the drive of the current working directory. For example, if the current working directory is r"Z:\eggs", then r"\spam" resolves to r"Z:\spam". Also, a drive-relative paths such as "Z:spam" depends on the working directory of the given drive. Windows supports a separate working directory for each drive. For example, if the working directory of drive "Z:" is r"Z:\eggs", then "Z:spam" resolves to r"Z:\eggs\spam". |
|
Date |
User |
Action |
Args |
2022-04-01 14:09:00 | eryksun | set | recipients:
+ eryksun, brett.cannon, paul.moore, docs@python, veky, ChrisBarker, Zim, 4-launchpad-kalvdans-no-ip-org, florisla, John-Hennig |
2022-04-01 14:09:00 | eryksun | set | messageid: <1648822140.44.0.972281200899.issue39090@roundup.psfhosted.org> |
2022-04-01 14:09:00 | eryksun | link | issue39090 messages |
2022-04-01 14:09:00 | eryksun | create | |
|