Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-89812: Churnpathlib.Path methods#104243

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

Already on GitHub?Sign in to your account

Conversation

barneygale
Copy link
Contributor

@barneygalebarneygale commentedMay 6, 2023
edited by bedevere-bot
Loading

Re-arrangepathlib.Path methods in source code. No other changes.

The methods are arranged as follows:

  1. stat() and dependants (exists(),is_dir(), etc)
  2. open() and dependants (read_text(),write_bytes(), etc)
  3. iterdir() and dependants (glob(),walk(), etc)
  4. All otherPath methods

This patch prepares the ground for a new_AbstractPath class, which will support the methods in groups 1, 2 and 3 above. By churning the methods here, subsequent patches will be easier to review and less likely to break things.

Re-arrange `pathlib.Path` methods in source code. No other changes.The methods are arranged as follows:1. `stat()` and dependants (`exists()`, `is_dir()`, etc)2. `open()` and dependants (`read_text()`, `write_bytes()`, etc)3. `iterdir()` and dependants (`glob()`, `walk()`, etc)4. All other `Path` methodsThis patch prepares the ground for a new `_AbstractPath` class, which willsupport the methods in groups 1, 2 and 3 above. By churning the methodshere, subsequent patches will be easier to review and less likely to breakthings.
@barneygale
Copy link
ContributorAuthor

I know these sorts of PRs suck. Unfortunately it's pretty much unavoidable if we want to add apathlib._AbstractPath class. I've attempted to reduce the suckage by isolating it as much as possible and taking it upfront.

Eclips4 reacted with thumbs up emoji

@barneygalebarneygale added the 3.13bugs and security fixes labelMay 6, 2023
@AA-Turner
Copy link
Member

Do you intend to backport this to 3.11? Whilst not a bug fix, any future bug fixes requiring a backport would always require manual cherry picking, until 3.11 goes security-only.

A

@barneygale
Copy link
ContributorAuthor

Backports of pathlib bugfixes into 3.11 are already likely to run into conflicts I think, as pathlib has changed quite a lot under-the-hood in 3.12. I suspect that backporting this change into 3.11 won't be helpful.

AA-Turner reacted with thumbs up emoji

@AA-Turner
Copy link
Member

Ahh, makes sense -- thanks!

barneygale reacted with thumbs up emoji

@barneygalebarneygale added the 3.12only security fixes labelMay 7, 2023
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotAMD64 Debian root 3.x has failed when building commite8d77b0.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/345/builds/4706) and take a look at the build logs.
  4. Check if the failure is related to this commit (e8d77b0) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/345/builds/4706

Failed tests:

  • test_threading

Summary of the results of the build (if available):

==

Click to see traceback logs
remote:Enumerating objects: 7, done.remote:Counting objects:  14% (1/7)remote:Counting objects:  28% (2/7)remote:Counting objects:  42% (3/7)remote:Counting objects:  57% (4/7)remote:Counting objects:  71% (5/7)remote:Counting objects:  85% (6/7)remote:Counting objects: 100% (7/7)remote:Counting objects: 100% (7/7), done.remote:Compressing objects:  25% (1/4)remote:Compressing objects:  50% (2/4)remote:Compressing objects:  75% (3/4)remote:Compressing objects: 100% (4/4)remote:Compressing objects: 100% (4/4), done.remote:Total 4 (delta 3), reused 0 (delta 0), pack-reused 0From https://github.com/python/cpython * branch                  main       -> FETCH_HEADNote:switching to 'e8d77b03e08a4c7e7dde0830c5a12a0b41ff7c33'.You are in 'detached HEAD' state. You can look around, make experimentalchanges and commit them, and you can discard any commits you make in thisstate without impacting any branches by switching back to a branch.If you want to create a new branch to retain commits you create, you maydo so (now or later) by using -c with the switch command. Example:  git switch -c <new-branch-name>Or undo this operation with:  git switch -Turn off this advice by setting config variable advice.detachedHead to falseHEAD is now at e8d77b03e0 GH-89812: Churn `pathlib.Path` methods (GH-104243)Switched to and reset branch 'main'configure:WARNING: pkg-config is missing. Some dependencies may not be detected correctly.Fatal Python error: Segmentation faultThread 0x00007f291a645280 (most recent call first):  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/runner.py", line 74 in _write_status  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/runner.py", line 95 in addSuccess  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/testresult.py", line 122 in addSuccess  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/case.py", line 648 in run  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/case.py", line 690 in __call__  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/suite.py", line 122 in run  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/suite.py", line 84 in __call__  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/suite.py", line 122 in run  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/suite.py", line 84 in __call__  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/suite.py", line 122 in run  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/suite.py", line 84 in __call__  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/runner.py", line 240 in run  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/__init__.py", line 1106 in _run_suite  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/__init__.py", line 1232 in run_unittest  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/runtest.py", line 294 in _test_module  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/runtest.py", line 330 in _runtest_inner2  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/runtest.py", line 373 in _runtest_inner  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/runtest.py", line 248 in _runtest  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/runtest.py", line 278 in runtest  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/main.py", line 365 in rerun_failed_tests  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/main.py", line 783 in _main  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/main.py", line 738 in main  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/libregrtest/main.py", line 802 in main  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/__main__.py", line 2 in <module>  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/runpy.py", line 88 in _run_code  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/runpy.py", line 198 in _run_module_as_mainExtension modules: _testcapi (total: 1)Segmentation faultmake:*** [Makefile:1956: buildbottest] Error 139Cannot open file '/root/buildarea/3.x.angelico-debian-amd64/build/test-results.xml' for upload

jbower-fb pushed a commit to jbower-fb/cpython that referenced this pull requestMay 8, 2023
Re-arrange `pathlib.Path` methods in source code. No other changes.The methods are arranged as follows:1. `stat()` and dependants (`exists()`, `is_dir()`, etc)2. `open()` and dependants (`read_text()`, `write_bytes()`, etc)3. `iterdir()` and dependants (`glob()`, `walk()`, etc)4. All other `Path` methodsThis patch prepares the ground for a new `_AbstractPath` class, which willsupport the methods in groups 1, 2 and 3 above. By churning the methodshere, subsequent patches will be easier to review and less likely to breakthings.
carljm added a commit to carljm/cpython that referenced this pull requestMay 9, 2023
* main: (47 commits)pythongh-97696 Remove unnecessary check for eager_start kwarg (python#104188)pythonGH-104308: socket.getnameinfo should release the GIL (python#104307)pythongh-104310: Add importlib.util.allowing_all_extensions() (pythongh-104311)pythongh-99113: A Per-Interpreter GIL! (pythongh-104210)pythonGH-104284: Fix documentation gettext build (python#104296)pythongh-89550: Buffer GzipFile.write to reduce execution time by ~15% (python#101251)pythongh-104223: Fix issues with inheriting from buffer classes (python#104227)pythongh-99108: fix typo in Modules/Setup (python#104293)pythonGH-104145: Use fully-qualified cross reference types for the bisect module (python#104172)pythongh-103193: Improve `getattr_static` test coverage (python#104286)  Trim trailing whitespace and test on CI (python#104275)pythongh-102500: Remove mention of bytes shorthand (python#104281)pythongh-97696: Improve and fix documentation for asyncio eager tasks (python#104256)pythongh-99108: Replace SHA3 implementation HACL* version (python#103597)pythongh-104273: Remove redundant len() calls in argparse function (python#104274)pythongh-64660: Don't hardcode Argument Clinic return converter result variable name (python#104200)pythongh-104265 Disallow instantiation of `_csv.Reader` and `_csv.Writer` (python#104266)pythonGH-102613: Improve performance of `pathlib.Path.rglob()` (pythonGH-104244)pythongh-103650: Fix perf maps address format (python#103651)pythonGH-89812: Churn `pathlib.Path` methods (pythonGH-104243)  ...
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra approved these changes

Assignees
No one assigned
Labels
3.12only security fixes3.13bugs and security fixesskip newstopic-pathlib
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@barneygale@AA-Turner@bedevere-bot@JelleZijlstra

[8]ページ先頭

©2009-2025 Movatter.jp