-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
GH-78079: Fix UNC device path root normalization in pathlib #102003
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
Changes from 1 commit
99f62bc
6651b67
87519ba
c444a3c
36623c0
aea236e
bb0af91
f412f87
8ff07fc
723a5aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -330,8 +330,7 @@ def _parse_path(cls, path): | |
| elif len(drv_parts) == 6: | ||
| # e.g. //?/unc/server/share | ||
| root = sep | ||
| unfiltered_parsed = [drv + root] + rel.split(sep) | ||
| parsed = [sys.intern(x) for x in unfiltered_parsed if x and x != '.'] | ||
| parsed = [sys.intern(str(x)) for x in rel.split(sep) if x and x != '.'] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoa, we Don't we already know that Footnotes
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The interning of the path parts is longstanding pathlib behaviour. Honestly I don't know enough about the benefits/drawbacks of interning to say whether it's reasonable.
We know that it's an instance of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Is it really all that bad? >>> s = sys.intern('spam and eggs')
>>> t = sys.intern('spam and eggs')
>>> s is t
True
>>> id(s)
139835455199152
>>> del s, t
>>> s = sys.intern('spam and eggs')
>>> id(s)
139835455198912 |
||
| return drv, root, parsed | ||
|
|
||
| def _load_parts(self): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.