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-80486: Fix handling of NTFS alternate data streams in pathlib by barneygale · Pull Request #102454 · python/cpython

Conversation

@barneygale

@barneygale barneygale commented Mar 6, 2023 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

This fixes round-tripping of Windows paths like ./c:a in pathlib.

Previously, pathlib removed the ./ prefix when generating a string representation of such paths. This changed the meaning, from a file in the current directory called "c" with an NTFS alternate data stream, to a relative path on the "c:" drive.

Most of the patch by @kmaork. I brought it up-to-date.

  • Issue: Inconsistent behavior of pathlib.WindowsPath with drive paths #80486

Sorry, something went wrong.

Uh oh!

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

All reactions
kmaork and others added 7 commits June 14, 2019 00:36
@kmaork
Fixed bugs with drive-relative paths and NTFS ADS paths in pathlib
15aadf9
@kmaork
Merge branch 'master' into fix-issue-36305
c827f98
@kmaork
Merge branch 'master' into fix-issue-36305
64fc342
@barneygale
Undo pathlib changes
86c0408
@barneygale
Merge branch 'main' into pythongh-80486-ntfs-alt-stream-path
c08602b
@barneygale
Remove a couple of incorrect test cases
cb9ce9d
@barneygale
Fix _format_parsed_parts()
fe5cfb3
@bedevere-bot bedevere-bot mentioned this pull request Mar 6, 2023
Inconsistent behavior of pathlib.WindowsPath with drive paths #80486
Closed
@bedevere-bot bedevere-bot added the awaiting review label Mar 6, 2023
@barneygale barneygale changed the title GH-80486: Fix handling of NTFS alternate data streams GH-80486: Fix handling of NTFS alternate data streams in pathlib Mar 6, 2023
@barneygale

barneygale commented Mar 6, 2023

Copy link
Copy Markdown
Contributor Author

This won't backport as it relies on a number of internal changes in 3.12 only.

All reactions

Sorry, something went wrong.

Uh oh!

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

@barneygale barneygale added OS-windows topic-pathlib labels Mar 6, 2023
barneygale added 2 commits March 6, 2023 00:28
@barneygale
Restore deleted test case.
bc225f5
@barneygale
Fix expanduser()
9aa4077
zooba
zooba reviewed Mar 6, 2023
View reviewed changes
Comment thread Lib/pathlib.py Resolved

Uh oh!

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

barneygale added 3 commits March 6, 2023 16:40
@barneygale
Use _from_parsed_parts() in expanduser()
0be2dc4
@barneygale
Improve news blurb.
8386140
@barneygale
Remove test case affected by pythonGH-102475.
e6f11d4
zooba
zooba approved these changes Mar 6, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Mar 6, 2023
eryksun
eryksun reviewed Mar 6, 2023
View reviewed changes
Comment thread Lib/pathlib.py Resolved

Uh oh!

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

@barneygale barneygale mentioned this pull request Mar 7, 2023
Add C implementation of os.path.splitroot() #102511
Closed
@zooba

zooba commented Mar 10, 2023

Copy link
Copy Markdown
Member

Are we going to wait for #102511 to be implemented? Or leave a note in that one to update this use when it's done?

As this issue is about correctness and the other is about performance, I'd prefer not to wait.

All reactions

Sorry, something went wrong.

Uh oh!

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

@barneygale

barneygale commented Mar 10, 2023

Copy link
Copy Markdown
Contributor Author

Personally I'd rather not wait! :)

All reactions

Sorry, something went wrong.

Uh oh!

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

@zooba

zooba commented Mar 10, 2023

Copy link
Copy Markdown
Member

Feel free to merge (and backport as appropriate), then!

All reactions

Sorry, something went wrong.

Uh oh!

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

@barneygale

barneygale commented Mar 10, 2023

Copy link
Copy Markdown
Contributor Author

I'm not a core dev so I don't have any merge permissions I don't think! 😅

All reactions

Sorry, something went wrong.

Uh oh!

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

@zooba

zooba commented Mar 10, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Oh aren't you? We should probably fix that 😉 (though I'm literally about to step away for the weekend, so next week)

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

barneygale commented Mar 10, 2023

Copy link
Copy Markdown
Contributor Author

(and unfortunately this won't backport due to other changes in 3.12 being required)

zooba 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.

@zooba
zooba merged commit 90f1d77 into python:main Mar 10, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Mar 10, 2023
@barneygale barneygale mentioned this pull request Mar 10, 2023
bpo-36305: Fixes to path handling and parsing in pathlib #12361
Closed
iritkatriel pushed a commit to iritkatriel/cpython that referenced this pull request Mar 12, 2023
@barneygale @kmaork @iritkatriel
pythonGH-80486: Fix handling of NTFS alternate data streams in pathlib (
5f49d2d
pythonGH-102454)

Co-authored-by: Maor Kleinberger <[email protected]>
@barneygale barneygale mentioned this pull request Apr 20, 2023
PurePosixPath no longer correctly parses PureWindowsPath #103631
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
@zooba zooba zooba approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

OS-windows topic-pathlib

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.

5 participants

@barneygale @zooba @eryksun @bedevere-bot @kmaork
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.