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

bpo-27827: pathlib: identify a greater range of reserved filename on Windows. #26698

Merged
merged 1 commit into from Jul 28, 2021

Conversation

@barneygale
Copy link
Contributor

@barneygale barneygale commented Jun 12, 2021

pathlib.PureWindowsPath.is_reserved() now identifies as reserved filenames with trailing spaces or colons.

All credit to Eryk Sun for this patch.

https://bugs.python.org/issue27827

`pathlib.PureWindowsPath.is_reserved()` now identifies as reserved
filenames with trailing spaces or colons.

Co-Authored-By: Eryk Sun <eryksun@gmail.com>
# path processing. Thus relative paths are not resolved and slash is not
# translated to backslash. It has the native NT path limit of 32767
# characters, but a bit less after resolving device symbolic links,
# such as '\??\C:' => '\Device\HarddiskVolume2'.
Copy link

@jaykrell jaykrell Jul 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do those in-memory symlinks really detract from the limit?
I.e. is a new full path really formed,
or just the remaining part is passed to the FS driver?

@ambv ambv merged commit 56c1f6d into python:main Jul 28, 2021
13 checks passed
@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jul 28, 2021

Thanks @barneygale for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.9.
🐍🍒🤖

miss-islington added a commit to miss-islington/cpython that referenced this issue Jul 28, 2021
…ythonGH-26698)

`pathlib.PureWindowsPath.is_reserved()` now identifies as reserved
filenames with trailing spaces or colons.

Co-authored-by: Barney Gale <barney.gale@foundry.com>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
(cherry picked from commit 56c1f6d)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Jul 28, 2021

GH-27421 is a backport of this pull request to the 3.10 branch.

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Jul 28, 2021

GH-27422 is a backport of this pull request to the 3.9 branch.

miss-islington added a commit to miss-islington/cpython that referenced this issue Jul 28, 2021
…ythonGH-26698)

`pathlib.PureWindowsPath.is_reserved()` now identifies as reserved
filenames with trailing spaces or colons.

Co-authored-by: Barney Gale <barney.gale@foundry.com>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
(cherry picked from commit 56c1f6d)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
ambv pushed a commit that referenced this issue Jul 28, 2021
…H-26698) (GH-27421)

`pathlib.PureWindowsPath.is_reserved()` now identifies as reserved
filenames with trailing spaces or colons.

Co-authored-by: Barney Gale <barney.gale@foundry.com>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
(cherry picked from commit 56c1f6d)
ambv pushed a commit that referenced this issue Jul 28, 2021
…H-26698) (#27422)

`pathlib.PureWindowsPath.is_reserved()` now identifies as reserved
filenames with trailing spaces or colons.

Co-authored-by: Barney Gale <barney.gale@foundry.com>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
(cherry picked from commit 56c1f6d)
JuniorJPDJ added a commit to JuniorJPDJ/cpython that referenced this issue Aug 12, 2021
…ythonGH-26698)

`pathlib.PureWindowsPath.is_reserved()` now identifies as reserved
filenames with trailing spaces or colons.

Co-authored-by: Barney Gale <barney.gale@foundry.com>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants