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 — [3.12] gh-102511: Fix `os.path.normpath()` for UNC paths on Windows. by nineteendo · Pull Request #119394 · python/cpython

Conversation

@nineteendo

@nineteendo nineteendo commented May 22, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor
  • Issue: Add C implementation of os.path.splitroot() #102511

Sorry, something went wrong.

Uh oh!

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

All reactions
@nineteendo
pythongh-102511: Speed up os.path.splitroot() with native helpers (py…
6872edd
…thonGH-118089)
This was referenced May 22, 2024
Add C implementation of os.path.splitroot() #102511
Closed
gh-102511: Add C implementation of os.path.splitroot() #118089
Merged
@nineteendo

nineteendo commented May 22, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

Fixes ntpath.normpath('//?/UNC/server/share/..') and makes it easier to back port an upcoming pull request.
If you don't want to use the C implementation of os.path.splitroot() when available, I can leave it out.

All reactions

Sorry, something went wrong.

Uh oh!

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

@nineteendo
nineteendo marked this pull request as ready for review May 22, 2024 12:48
@bedevere-app bedevere-app Bot added the awaiting review label May 22, 2024
@zooba zooba added the DO-NOT-MERGE label May 22, 2024
@zooba

zooba commented May 22, 2024

Copy link
Copy Markdown
Member

I want to hold this for a bit until we're confident in the change in later versions. Virtually every time we touch this kind of code, we introduce new failures or vulnerabilities, so let's keep it restricted to prerelease versions for now.

I'd say after 3.13.0b3 is released we'll reconsider, but that's because I'm hopeful we'll get a decent amount of people trying out those betas. If it seems like nobody is using them, we'll push this further.

All reactions

Sorry, something went wrong.

Uh oh!

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

@zooba zooba self-assigned this May 22, 2024
@nineteendo
nineteendo marked this pull request as draft May 22, 2024 19:05
@bedevere-app bedevere-app Bot removed the awaiting review label May 22, 2024
nineteendo added 2 commits May 28, 2024 12:30
@nineteendo
Merge remote-tracking branch 'upstream/3.12' into backport-10bb90e-3.12
5689108
@nineteendo
Direct C call for os.path.splitroot()
d51eea6
@erlend-aasland

erlend-aasland commented May 30, 2024

Copy link
Copy Markdown
Contributor

@zooba, why is this being considered for 3.12?

All reactions

Sorry, something went wrong.

Uh oh!

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

@zooba

zooba commented May 31, 2024

Copy link
Copy Markdown
Member

@erlend-aasland For the reasons nineteendo mentioned above:

Fixes ntpath.normpath('//?/UNC/server/share/..') and makes it easier to back port an upcoming pull request.

Performance optimisations are usually okay in bugfix releases as well, provided they aren't changing public APIs, but generally aren't deemed worth the churn on their own. In this case, keeping the implementation consistent pushes it over the edge, IMHO.

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

@erlend-aasland

erlend-aasland commented May 31, 2024

Copy link
Copy Markdown
Contributor

Performance optimisations are usually okay in bugfix releases [...]

We normally do not backport performance optimisations unless we're talking about performance degradations that classify as bugs.

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

@erlend-aasland

erlend-aasland commented May 31, 2024

Copy link
Copy Markdown
Contributor

Quoting the devguide, for visibility:

The only changes allowed to occur in a maintenance branch without debate are bug fixes, test improvements, and edits to the documentation. Also, a general rule for maintenance branches is that compatibility must not be broken at any point between sibling micro releases (3.5.1, 3.5.2, etc.). For both rules, only rare exceptions are accepted and must be discussed first.

All reactions

Sorry, something went wrong.

Uh oh!

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

@nineteendo

nineteendo commented May 31, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

I don't see the problem here. We are fixing a bug, while at the same time improving the performance of os.path.splitroot(). I specifically asked whether it's OK to use the C implementation of os.path.splitroot():

If you don't want to use the C implementation of os.path.splitroot() when available, I can leave it out.

All reactions

Sorry, something went wrong.

Uh oh!

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

@zooba

zooba commented May 31, 2024

Copy link
Copy Markdown
Member

A performance-optimisation for performation-optimisation's sake, I agree. This is also ensuring that the code remains the same between supported versions, which makes backporting easier.

If the concern is the description of the fix, we can change it for 3.12. It won't match the description of the equivalent code that's already in 3.13, but that doesn't bother me.

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

blurb-it Bot and others added 2 commits May 31, 2024 14:43
@blurb-it
📜🤖 Added by blurb_it.
0b9547f
@nineteendo
Delete Misc/NEWS.d/next/Core and Builtins/2024-04-19-08-50-48.gh-issu…
e800e85
…e-102511.qDEB66.rst
@nineteendo nineteendo changed the title [3.12] gh-102511: Speed up os.path.splitroot() with native helpers (GH-118089) [3.12] gh-102511: Fix os.path.normpath() for UNC paths on Windows. May 31, 2024
@gpshead

gpshead commented May 31, 2024

Copy link
Copy Markdown
Member

This needs unittests ensuring that the C and Python versions of the functions have identical behavior (in main, not just in this backport).

If you want to propose this for backporting, it helps to make the change easy to understand what changed from a simple GH diff view. To do that, please don't indent the existing Python splitroot() implementations. Keep those at the top level, just renaming them to _py_splitroot, and using the conditional import logic only to assign/redefine the appropriate function to the splitroot name within the new code. This is also needed for testing purposes so that both versions exist. Work all that out in main first.

erlend-aasland 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.

@gpshead

gpshead commented May 31, 2024

Copy link
Copy Markdown
Member

The Issue and the change in main/3.13 do not mention anything about a bug being fixed in the Issue, PR description, or commit message.

What was the bug?

Please make sure the Issue explains what the bug was and new desired behavior is, and that the NEWS entry in main/3.13 is fixed to describe the bugfix before considering a backport.

erlend-aasland and zooba reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

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

@nineteendo

nineteendo commented May 31, 2024

Copy link
Copy Markdown
Contributor Author

What was the bug?

>>> ntpath.normpath('//?/UNC/server/share/../..')
'\\\\?\\UNC\\' # instead of '\\\\?\\UNC\\server\\share\\'
All reactions

Sorry, something went wrong.

Uh oh!

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

@nineteendo
Rename 2024-05-31-14-43-25.gh-issue-102511.kl4x8H.rst to 2024-05-31-1…
9b930a5
…4-43-25.gh-issue-102511.kl4x8H.rst
@ghost

ghost commented Oct 14, 2024 •
edited by ghost
Loading

Uh oh!

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

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

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

@nineteendo
nineteendo force-pushed the backport-10bb90e-3.12 branch from 91cc736 to 9b930a5 Compare October 14, 2024 06:25
@nineteendo
Merge remote-tracking branch 'upstream/3.12' into backport-10bb90e-3.12
43993c5
@nineteendo
nineteendo force-pushed the backport-10bb90e-3.12 branch from 3308d41 to 43993c5 Compare October 14, 2024 06:33
@nineteendo
nineteendo marked this pull request as ready for review October 14, 2024 06:37
@bedevere-app bedevere-app Bot added the awaiting review label Oct 14, 2024
@nineteendo

nineteendo commented Oct 14, 2024

Copy link
Copy Markdown
Contributor Author

Steve, can we re-consider now? I've waited a bit longer until 3.13 was released.

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland

erlend-aasland commented Oct 14, 2024

Copy link
Copy Markdown
Contributor

The 3.12 bug-fix-window is considerably smaller now, implying that the code-remains-the-same argument of #119394 (comment) is considerably weakened.

All reactions

Sorry, something went wrong.

Uh oh!

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

@zooba

zooba commented Oct 16, 2024

Copy link
Copy Markdown
Member

The 3.12 bug-fix-window is considerably smaller now, implying that the code-remains-the-same argument...

I'd rate this code as security-sensitive, meaning it's more likely to get fixes that we'd have to backport throughout all security releases. But that also suggests we shouldn't be changing it for an issue that already existed in case we create a new issue. Plus it means a backport would likely need customisation for older versions anyway. The one year window where it's definitely worth it (after 3.11 is EOL) isn't very long, and the bug wasn't reported specifically, but was discovered.

I'm leaning towards status quo (don't merge), just because we apparently haven't upset anyone yet (except perhaps nineteendo, sorry) and not changing things rarely makes it worse.

All reactions

Sorry, something went wrong.

Uh oh!

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

@nineteendo

nineteendo commented Oct 16, 2024

Copy link
Copy Markdown
Contributor Author

I'm leaning towards status quo (don't merge), just because we apparently haven't upset anyone yet (except perhaps nineteendo, sorry) and not changing things rarely makes it worse.

It's fine, I'm just happy I can finally delete this branch and forget about it.

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.

@nineteendo nineteendo closed this Oct 16, 2024
@nineteendo
nineteendo deleted the backport-10bb90e-3.12 branch October 16, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

@zooba zooba

Labels

awaiting review DO-NOT-MERGE

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.

4 participants

@nineteendo @zooba @erlend-aasland @gpshead
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 01402520 — 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.