[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2022-04-04 Thread Barney Gale
Barney Gale added the comment: The docs for PurePath.is_absolute() say: > A path is considered absolute if it has both a root and (if the flavour > allows) a drive This does not preclude it from having ".." segments. PurePath.absolute() is documented as of bpo-29688 / 3.11, see:

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2022-04-01 Thread Brett Cannon
Change by Brett Cannon : -- nosy: +barneygale ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2022-04-01 Thread Eryk Sun
Eryk Sun added the comment: > 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

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2022-04-01 Thread Vedran Čačić
Vedran Čačić added the comment: > First, I hope we all agree: > 'C:\Windows\..\Program Files' and '/usr/../bin' == relative path I don't agree. To me, absolute means regardless of a reference point. So, absolute path would be a path that refers to the same entity from whichever directory you

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2022-03-31 Thread EZ
EZ added the comment: First, I hope we all agree: 'C:\Windows' and '/usr/bin' == absolute path 'Windows' and 'bin' == relative path 'C:\Program Files' and '/bin' == absolute path 'C:\Windows\..\Program Files' and '/usr/../bin' == relative path It is very confusing between these two, but

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2021-03-17 Thread 4-launchpad-kalvdans-no-ip-org
Change by 4-launchpad-kalvdans-no-ip-org : -- nosy: +4-launchpad-kalvdans-no-ip-org ___ Python tracker ___ ___ Python-bugs-list

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2021-02-24 Thread John Hennig
John Hennig added the comment: @Floris: > Not mentioning Path.resolve()'s behavior w.r.t. non-existing files since that's documented in resolve() itself. I don't see it mentioned in the documentation of `resolve()`, or anywhere else in the docs, that on Windows (but not on other platforms)

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2020-02-24 Thread Floris Lambrechts
Floris Lambrechts added the comment: Based on the feedback received in GitHub here: https://github.com/florisla/cpython/commit/c146ad3d086fe9e401284c12fc670ea4f9398f3b I made a new revision of the 'Absolute paths' chapter here:

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2020-02-24 Thread Floris Lambrechts
Floris Lambrechts added the comment: (sorry, didn't see the GitHub comments before... I'll process those first.) -- ___ Python tracker ___

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2020-02-24 Thread Floris Lambrechts
Floris Lambrechts added the comment: @ChrisBarker, Could you review the proposed addition to the documentation? https://github.com/florisla/cpython/commit/c146ad3d086fe9e401284c12fc670ea4f9398f3b -- ___ Python tracker

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2020-02-15 Thread Vedran Čačić
Vedran Čačić added the comment: If we want something mnemonic, I'm sure nothing beats __abs__. (Hey, we have __truediv__ already!;) -- nosy: +veky ___ Python tracker ___

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2020-02-12 Thread Floris Lambrechts
Floris Lambrechts added the comment: This is the new chapter: https://github.com/florisla/cpython/commit/c146ad3d086fe9e401284c12fc670ea4f9398f3b -- ___ Python tracker ___

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2020-02-12 Thread Paul Moore
Paul Moore added the comment: You've provided links to your branches, but not to the specific text you're proposing to add. Can you link to a diff or something that shows what you've added more precisely? -- ___ Python tracker

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2020-02-12 Thread Floris Lambrechts
Floris Lambrechts added the comment: I've written an "Absolute paths" section based on the knowledge I found in the various threads. Any review is appreciated. https://github.com/florisla/cpython/tree/pathlib-chapter-absolute-paths With some related documentation changes:

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2020-02-10 Thread Paul Moore
Paul Moore added the comment: > In short -- I understand that this is a complex issue, but making an absolute > path is a pretty common use case, and we've had os.path.abspath() for > decades, so there should be one obvious way to do it, and it should be easily > discoverable. +1 on this.

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2019-12-27 Thread Josh Holland
Change by Josh Holland : -- nosy: +anowlcalledjosh ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2019-12-24 Thread Chris Barker
Chris Barker added the comment: Yes Please! I'd offer to help, but I really don't get the intricacies involved. I will offer to proofread and copy-edit though, if that's helpful. And I note that coincidentally, just in the last week, I needed to make an absolute path from a Path, and it

[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2019-12-18 Thread Brett Cannon
New submission from Brett Cannon : The question on how best to get an absolute path from a pathlib.Path object keeps coming up (see https://bugs.python.org/issue29688, https://discuss.python.org/t/add-absolute-name-to-pathlib-path/2882/, and