FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-86943: implement `pathlib.WindowsPath.is_mount()` by barneygale · Pull Request #31458 · python/cpython · GitHub

/ cpython Public

gh-86943: implement pathlib.WindowsPath.is_mount() - #31458

Merged
miss-islington merged 5 commits into
python:mainfrom
barneygale:bpo-42777-pathlib-is-mount-on-windows
Aug 5, 2022
Merged

gh-86943: implement pathlib.WindowsPath.is_mount()#31458
miss-islington merged 5 commits into
python:mainfrom
barneygale:bpo-42777-pathlib-is-mount-on-windows

Conversation

barneygale commented Feb 21, 2022
edited by miss-islington
Loading

Copy link
Copy Markdown
Contributor

Have pathlib.WindowsPath.is_mount() call ntpath.ismount(). Previously it raised NotImplementedError unconditionally.

https://bugs.python.org/issue42777

Automerge-Triggered-By: GH:brettcannon

barneygale marked this pull request as draft February 21, 2022 03:17
Comment thread Doc/library/pathlib.rst Outdated
AlexWaygood added the type-feature A feature request or enhancement label Apr 10, 2022

zmievsa commented May 19, 2022

Copy link
Copy Markdown
Contributor

Will review soon

Copy link
Copy Markdown
Contributor Author

Will review soon

Don't worry about it - I'm trying to focus my efforts on two more important PRs: #31691 and #91882. The branch has conflicts anyway.

barneygale marked this pull request as ready for review July 30, 2022 17:17
barneygale requested a review from brettcannon as a code owner July 30, 2022 17:17
barneygale changed the title bpo-42777: implement pathlib.WindowsPath.is_mount() gh-86943: implement pathlib.WindowsPath.is_mount() Jul 30, 2022

barneygale commented Jul 30, 2022
edited
Loading

Copy link
Copy Markdown
Contributor Author

Not sure what's going on with the test failure - looks like ntpath.ismount('C:/\x00') is true in main? It raises an exception in my Windows VM with Python 3.10.

eryksun commented Jul 30, 2022

Copy link
Copy Markdown
Contributor

Not sure what's going on with the test failure - looks like ntpath.ismount('C:/\x00') is true in main? It raises an exception in my Windows VM with Python 3.10.

The new implementation of normpath() strips the trailing null character. The old implementation keeps it.

These paths are invalid on posix and windows.

eryksun commented Jul 31, 2022

Copy link
Copy Markdown
Contributor

The new implementation of normpath() strips the trailing null character. The old implementation keeps it.

Do you think this needs to be fixed, or is it an improvement?

Copy link
Copy Markdown
Contributor Author

Do you think this needs to be fixed, or is it an improvement?

I think it's unlikely to come up in real world usage. IMO it's one of the quirks noted in 99fcf15:

This commit attempts to preserve every previously tested quirk, but these may be changed in the future to better align platforms.

iritkatriel pushed a commit to iritkatriel/cpython that referenced this pull request Aug 11, 2022
…31458)

Have `pathlib.WindowsPath.is_mount()` call `ntpath.ismount()`. Previously it raised `NotImplementedError` unconditionally.


https://bugs.python.org/issue42777
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-pathlib type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants


Back | FazBrowse Home | New Git URL