Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

barneygale
Copy link
Contributor

@barneygale barneygale commented Feb 21, 2022

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

https://bugs.python.org/issue42777

Automerge-Triggered-By: GH:brettcannon

@barneygale barneygale marked this pull request as draft Feb 21, 2022
Doc/library/pathlib.rst Outdated Show resolved Hide resolved
@AlexWaygood AlexWaygood added the type-feature A feature request or enhancement label Apr 10, 2022
@Ovsyanka83
Copy link
Contributor

@Ovsyanka83 Ovsyanka83 commented May 19, 2022

Will review soon

@barneygale
Copy link
Contributor Author

@barneygale barneygale commented May 20, 2022

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 barneygale marked this pull request as ready for review Jul 30, 2022
@barneygale barneygale requested a review from brettcannon as a code owner Jul 30, 2022
@barneygale barneygale changed the title bpo-42777: implement pathlib.WindowsPath.is_mount() gh-86943: implement pathlib.WindowsPath.is_mount() Jul 30, 2022
@barneygale
Copy link
Contributor Author

@barneygale barneygale commented Jul 30, 2022

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
Copy link
Contributor

@eryksun eryksun commented Jul 30, 2022

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
Copy link
Contributor

@eryksun eryksun commented Jul 31, 2022

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?

@barneygale
Copy link
Contributor Author

@barneygale barneygale commented Jul 31, 2022

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.

@brettcannon brettcannon added the 🤖 automerge PR will be merged once it's been approved and all CI passed label Aug 5, 2022
@miss-islington miss-islington merged commit 29650fe into python:main Aug 5, 2022
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expert-pathlib 🤖 automerge PR will be merged once it's been approved and all CI passed type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants