bpo-27827: pathlib: identify a greater range of reserved filename on Windows. by barneygale · Pull Request #26698 · python/cpython (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation4 Commits1 Checks0 Files changed

Conversation

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

[ Show hidden characters]({{ revealButtonHref }})

barneygale

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

@barneygale @eryksun

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

Co-Authored-By: Eryk Sun eryksun@gmail.com

jaykrell

# 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'.

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?

@miss-islington

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 pushed a commit to miss-islington/cpython that referenced this pull request

Jul 28, 2021

@barneygale @miss-islington

…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

@bedevere-bot

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Jul 28, 2021

@barneygale @miss-islington

…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 pull request

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 pull request

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)