GeezerVison is showing github.com — GH-89812: Churn `pathlib.Path` methods by barneygale · Pull Request #104243 · python/cpython
Conversation
barneygale
commented
May 6, 2023
•
edited by bedevere-bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Re-arrange pathlib.Path methods in source code. No other changes.
The methods are arranged as follows:
stat() and dependants (exists(), is_dir(), etc)
open() and dependants (read_text(), write_bytes(), etc)
iterdir() and dependants (glob(), walk(), etc)
- All other
Path 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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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` 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.
|
I know these sorts of PRs suck. Unfortunately it's pretty much unavoidable if we want to add a pathlib._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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Ahh, makes sense -- thanks!
|
barneygale reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot AMD64 Debian root 3.x has failed when building commit e8d77b0.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- 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.
- Check if the failure is related to this commit (e8d77b0) or if it is a false positive.
- 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:
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 0
From https://github.com/python/cpython
* branch main -> FETCH_HEAD
Note: switching to 'e8d77b03e08a4c7e7dde0830c5a12a0b41ff7c33'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do 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 false
HEAD 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 fault
Thread 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_main
Extension modules: _testcapi (total: 1)
Segmentation fault
make: *** [Makefile:1956: buildbottest] Error 139
Cannot open file '/root/buildarea/3.x.angelico-debian-amd64/build/test-results.xml' for upload
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
jbower-fb
pushed a commit
to jbower-fb/cpython
that referenced
this pull request
May 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` 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.
carljm
added a commit
to carljm/cpython
that referenced
this pull request
May 9, 2023
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.
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.
|