GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-86943: implement `pathlib.WindowsPath.is_mount()` by barneygale · Pull Request #31458 · python/cpython

Conversation

@barneygale

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

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

https://bugs.python.org/issue42777

  • Issue: WindowsPath does not implement is_mount but ntpath implements and offers a ismount method #86943

Automerge-Triggered-By: GH:brettcannon

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@barneygale
bpo-42777: implement pathlib.WindowsPath.is_mount()
897fd22
@bedevere-bot bedevere-bot added the awaiting review label Feb 21, 2022
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Feb 21, 2022
@barneygale
Fix Windows tests
c61c72c
@barneygale
barneygale marked this pull request as draft February 21, 2022 03:17
eryksun
eryksun reviewed Feb 21, 2022
View reviewed changes
Comment thread Doc/library/pathlib.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@AlexWaygood AlexWaygood added the type-feature A feature request or enhancement label Apr 10, 2022
@zmievsa

zmievsa commented May 19, 2022

Copy link
Copy Markdown
Contributor

Will review soon

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@barneygale

barneygale commented May 20, 2022

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.

zmievsa reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon brettcannon added the topic-pathlib label Jun 21, 2022
@ezio-melotti ezio-melotti removed the CLA signed label Jul 13, 2022
barneygale added 2 commits July 30, 2022 18:13
@barneygale
Merge branch 'main' into bpo-42777-pathlib-is-mount-on-windows
726be72
@barneygale
Address feedback, bring up-to-date.
97a9b72
@barneygale
barneygale marked this pull request as ready for review July 30, 2022 17:17
@barneygale
barneygale requested a review from brettcannon as a code owner July 30, 2022 17:17
@barneygale barneygale mentioned this pull request Jul 30, 2022
gh-68320, gh-88302 - Allow for pathlib.Path subclassing #31691
Merged
@barneygale barneygale changed the title bpo-42777: implement pathlib.WindowsPath.is_mount() gh-86943: implement pathlib.WindowsPath.is_mount() Jul 30, 2022
@barneygale

barneygale commented Jul 30, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eryksun

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.

barneygale reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@barneygale
Remove test that '/\x00` (posix) and 'c:\\\x00' aren't mounts.
8749589
These paths are invalid on posix and windows.
@eryksun

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@barneygale

barneygale commented Jul 31, 2022

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

brettcannon
brettcannon approved these changes Aug 5, 2022
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Aug 5, 2022
brettcannon
brettcannon approved these changes Aug 5, 2022
View reviewed changes
@brettcannon brettcannon added the 🤖 automerge label Aug 5, 2022
@miss-islington
miss-islington merged commit 29650fe into python:main Aug 5, 2022
@bedevere-bot bedevere-bot removed the awaiting merge label Aug 5, 2022
@d1b d1b mannequin mentioned this pull request Apr 10, 2022
WindowsPath does not implement is_mount but ntpath implements and offers a ismount method #86943
Closed
iritkatriel pushed a commit to iritkatriel/cpython that referenced this pull request Aug 11, 2022
@barneygale @iritkatriel
pythongh-86943: implement pathlib.WindowsPath.is_mount() (pythonGH-…
39d326f
…31458)

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


https://bugs.python.org/issue42777
@barneygale barneygale mentioned this pull request May 7, 2023
[WIP] GH-89812: Add tarfile.TarPath #104272
Closed
@barneygale barneygale mentioned this pull request Jul 2, 2023
GH-89812: Add pathlib._PathBase #106337
Merged
@barneygale barneygale mentioned this pull request Mar 28, 2025
str(zipfile.Path()) not working when root attribute is io.BytesIO #100609
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@eryksun eryksun eryksun left review comments
@brettcannon brettcannon brettcannon approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

topic-pathlib type-feature A feature request or enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@barneygale @zmievsa @eryksun @brettcannon @the-knights-who-say-ni @ezio-melotti @bedevere-bot @miss-islington @AlexWaygood
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.