René's URL Explorer Experiment


Title: GH-89812: Add `pathlib._PathBase` by barneygale · Pull Request #106337 · python/cpython · GitHub

Open Graph Title: GH-89812: Add `pathlib._PathBase` by barneygale · Pull Request #106337 · python/cpython

X Title: GH-89812: Add `pathlib._PathBase` by barneygale · Pull Request #106337 · python/cpython

Description: Add private pathlib._PathBase class. This will be used by an experimental PyPI package to incubate a tarfile.TarPath class. Implementation notes In pathlib.py: Split Path into _PathBase and Path Implement _PathBase.is_junction() and is_mount() using stat(). In the latter case, restore the implementation deleted in #31458 Implement _PathBase.resolve() using absolute() and readlink() Implement _PathBase._scandir() using iterdir() In test_pathlib.py: Add PathBaseTest to exercise the _PathBase class directly Split PathTest into DummyPathTest and PathTest. The former exercises a representative subclass of _PathBase. Add DummyPathWithSymlinksTest to exercise a similar subclass, this time with symlink support. Questionable bits In pathlib.py, the _PathBase.is_junction() and _PathBase.resolve() methods are new code. The latter is very performance-sensitive and may need more work. Future work Make pathlib._PathBase public. There's still at least a couple of things to do first: Make PurePath._flavour public Figure out what to do with _PathBase.__hash__(), __eq__(), and other comparison methods. Issue: gh-89812

Open Graph Description: Add private pathlib._PathBase class. This will be used by an experimental PyPI package to incubate a tarfile.TarPath class. Implementation notes In pathlib.py: Split Path into _PathBase and Path I...

X Description: Add private pathlib._PathBase class. This will be used by an experimental PyPI package to incubate a tarfile.TarPath class. Implementation notes In pathlib.py: Split Path into _PathBase and Path I...

Opengraph URL: https://github.com/python/cpython/pull/106337

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:6fc88116-c640-38de-29ee-85706dc8fb19
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB63C:385D0A:77840:A1CAE:6969CF1E
html-safe-nonce48dac660b4ea0bb7a07a4f854957ee0fbced1c4a5abf6460075cbda42ff52056
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjNDOjM4NUQwQTo3Nzg0MDpBMUNBRTo2OTY5Q0YxRSIsInZpc2l0b3JfaWQiOiI0MzQyMzA0Mjg4NDExMzQwNTc0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacfb43a1859aed1b4d557f38cb8e21b245bf5171f5f222aaa0124c1149f6f40cb2
hovercard-subject-tagpull_request:1416831341
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/106337/files
twitter:imagehttps://avatars.githubusercontent.com/u/960340?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/960340?s=400&v=4
og:image:altAdd private pathlib._PathBase class. This will be used by an experimental PyPI package to incubate a tarfile.TarPath class. Implementation notes In pathlib.py: Split Path into _PathBase and Path I...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneacedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release83c08c21cdda978090dc44364b71aa5bc6dcea79
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/106337/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F106337%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F106337%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/106337/files
Reloadhttps://github.com/python/cpython/pull/106337/files
Reloadhttps://github.com/python/cpython/pull/106337/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/106337/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/106337/files
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
barneygalehttps://github.com/barneygale
python:mainhttps://github.com/python/cpython/tree/main
barneygale:gh-89812-omgtarpathhttps://github.com/barneygale/cpython/tree/gh-89812-omgtarpath
Conversation 79 https://github.com/python/cpython/pull/106337
Commits 37 https://github.com/python/cpython/pull/106337/commits
Checks 0 https://github.com/python/cpython/pull/106337/checks
Files changed https://github.com/python/cpython/pull/106337/files
Please reload this pagehttps://github.com/python/cpython/pull/106337/files
GH-89812: Add pathlib._PathBase https://github.com/python/cpython/pull/106337/files#top
Show all changes 37 commits https://github.com/python/cpython/pull/106337/files
4b29e2e Add `pathlib._VirtualPath` barneygale Jun 23, 2023 https://github.com/python/cpython/pull/106337/commits/4b29e2e81d094aa902ab145d79ef9f97d0499df1
8ce0139 Add tests for `pathlib._VirtualPath` barneygale Jul 2, 2023 https://github.com/python/cpython/pull/106337/commits/8ce0139454b9a4937cc0c9a0b64bf971c642a38b
b850d11 Fix tests on Windows barneygale Jul 2, 2023 https://github.com/python/cpython/pull/106337/commits/b850d116c6c21d17f8a0b01ba40b97fb6384e515
39bf6b3 Fix tests on Windows (take 2) barneygale Jul 3, 2023 https://github.com/python/cpython/pull/106337/commits/39bf6b378b2d5111ba8c05a4d6b3d0f73c1ca6fc
0515dea Fix tests on Windows (take 3) barneygale Jul 3, 2023 https://github.com/python/cpython/pull/106337/commits/0515deaf96ad8d148936400ba88d8f9518ce3a1c
596016f Fix tests on Windows (take 4) barneygale Jul 3, 2023 https://github.com/python/cpython/pull/106337/commits/596016f2154fc916ad48ad79aacaaf5335fedb5e
1a6122b Add `tarfile.TarPath` barneygale Jul 3, 2023 https://github.com/python/cpython/pull/106337/commits/1a6122bc0ee919fd468cc2460db4da3a639375d4
6833ed8 Add docs for `tarfile.TarPath` barneygale Jul 3, 2023 https://github.com/python/cpython/pull/106337/commits/6833ed8a006ca90d811e2efb59330307b77c5c19
4d2e8a9 Add tests for `tarfile.TarPath` barneygale Jul 3, 2023 https://github.com/python/cpython/pull/106337/commits/4d2e8a923c936a195a8b7b7496ea909f06c58801
e4daac9 Merge branch 'main' into gh-89812-omgtarpath barneygale Jul 3, 2023 https://github.com/python/cpython/pull/106337/commits/e4daac9c27ce1ba2e7a7e0dbbf29e4cc17a32358
e3f2509 Merge branch 'main' into gh-89812-omgtarpath barneygale Jul 12, 2023 https://github.com/python/cpython/pull/106337/commits/e3f250954d3952851bd2be758c0aeac58fa5b8b7
508cabe Undo changes to tarfile. barneygale Jul 12, 2023 https://github.com/python/cpython/pull/106337/commits/508cabe051440b0f1a5f5ec902dc454156391417
2c56591 `_VirtualPath` --> `_PathBase` barneygale Jul 12, 2023 https://github.com/python/cpython/pull/106337/commits/2c565916bc86242f54ab5600344e67f1bf9cbd21
42fe91a Merge branch 'main' into gh-89812-omgtarpath barneygale Jul 19, 2023 https://github.com/python/cpython/pull/106337/commits/42fe91a44a1ee1a9fd229bf87fe63fa219db9125
8944098 Apply suggestions from code review barneygale Aug 28, 2023 https://github.com/python/cpython/pull/106337/commits/89440987805b583e9e1d42991e1140a7a4f63bc2
b61141a Improve _PathBase docstring barneygale Aug 28, 2023 https://github.com/python/cpython/pull/106337/commits/b61141ae2a568583e8825f691f39869398d8ec82
1e462b0 Explain use of nullcontext() in comment barneygale Aug 28, 2023 https://github.com/python/cpython/pull/106337/commits/1e462b08e67ce6e6878e4fa2cc0c3f7ac79d8576
6318eb7 Merge branch 'main' into gh-89812-omgtarpath barneygale Aug 28, 2023 https://github.com/python/cpython/pull/106337/commits/6318eb7b8adf5243007d4939927c554e65fee6b7
d321cad Align and test Path/PathBase docstrings barneygale Aug 28, 2023 https://github.com/python/cpython/pull/106337/commits/d321cadbfd53c47a60b2ce81b0ded5c5bac4057c
acfc1b0 Revise `_PathBase.is_junction()` barneygale Aug 28, 2023 https://github.com/python/cpython/pull/106337/commits/acfc1b04bdabeea77d7a286aeabdfb99afdb95c5
bc82225 Make is_junction() code more consistent with other is_*() methods. barneygale Aug 28, 2023 https://github.com/python/cpython/pull/106337/commits/bc82225072d8639e5be818dc7ad9110d229961f1
9b6377a Merge branch 'main' into gh-89812-omgtarpath barneygale Sep 2, 2023 https://github.com/python/cpython/pull/106337/commits/9b6377a8b8e7dd20b0e895cc2e513e2338b7fe95
c3127b8 Improve `UnsupportedOperation` exception message. barneygale Sep 2, 2023 https://github.com/python/cpython/pull/106337/commits/c3127b865d7bb8655d4d4e258e1361d75cbf9a4e
3540ae1 Slightly improve symlink loop code, exception message. barneygale Sep 2, 2023 https://github.com/python/cpython/pull/106337/commits/3540ae1a11a29dbd853ce32d1689e27be05dcfc7
c9f0f20 Restore deleted comment in `cwd()`, expand `_scandir()` comment. barneygale Sep 2, 2023 https://github.com/python/cpython/pull/106337/commits/c9f0f20daf503656c5f4d3c4f7239fc20ca08aeb
0ee10ca Make `_PathBase.is_junction()` immediately return false. barneygale Sep 2, 2023 https://github.com/python/cpython/pull/106337/commits/0ee10cac6cf01a92ca6c5fb90bfa3a2312ad3d6c
17eee2f MAX_SYMLINKS --> _MAX_SYMLINKS barneygale Sep 9, 2023 https://github.com/python/cpython/pull/106337/commits/17eee2fc16bdf56616f093c508df140d12e9bf95
c7c46bc `return self._unsupported()` --> `self._unsupported()` barneygale Sep 9, 2023 https://github.com/python/cpython/pull/106337/commits/c7c46bc5f7b2b26cb993627e7aa7db21063c048f
a51d7a0 WIP barneygale Sep 15, 2023 https://github.com/python/cpython/pull/106337/commits/a51d7a0028d8a8629560ace4f70730b56d33347f
7e3729e Undo test change. barneygale Sep 23, 2023 https://github.com/python/cpython/pull/106337/commits/7e3729e017673a89b21d6960a37955a31ce0dd23
b945cf8 Merge branch 'main' into gh-89812-omgtarpath barneygale Sep 26, 2023 https://github.com/python/cpython/pull/106337/commits/b945cf89b8993db87aa7be827126598fafd8792f
703fe5c Ensure `..` segments are resolved in non-strict mode barneygale Sep 26, 2023 https://github.com/python/cpython/pull/106337/commits/703fe5ccd5c7ca31d0da889d245daf470f1d6fa4
e5e5be5 Move symlink loop resolution test from `PosixPathTest` to `DummyPathT… barneygale Sep 26, 2023 https://github.com/python/cpython/pull/106337/commits/e5e5be5d9962a169fc14df8e41e0ce03f29a82fb
38769a0 Add `PathBase._split_stack()` helper method. barneygale Sep 26, 2023 https://github.com/python/cpython/pull/106337/commits/38769a0ff7e9299ed4dc6a8e1825cd7eae122c8b
7c78952 Use path object as stat/link target cache key barneygale Sep 26, 2023 https://github.com/python/cpython/pull/106337/commits/7c78952cc951583f80a311079f0b98b15f3eb726
fe57725 Optimise resolve(): skip stat() in non-strict mode if readlink() is u… barneygale Sep 27, 2023 https://github.com/python/cpython/pull/106337/commits/fe57725fc2e1e812ba470c1f9d625b051518698d
cf9c8b6 Address code review comments barneygale Sep 29, 2023 https://github.com/python/cpython/pull/106337/commits/cf9c8b68bab433d807f4b5ddf79b75df02f7b259
Clear filters https://github.com/python/cpython/pull/106337/files
Please reload this pagehttps://github.com/python/cpython/pull/106337/files
Please reload this pagehttps://github.com/python/cpython/pull/106337/files
pathlib.py https://github.com/python/cpython/pull/106337/files#diff-fa525485738fc33d05b06c159172ff1f319c26e88d8c6bb39f7dbaae4dc4105c
test_pathlib.py https://github.com/python/cpython/pull/106337/files#diff-3dd97d2dc8816848d0b0c442e8fdeec9650b3de77935289a93f37ac6396ee17f
2023-07-03-20-23-56.gh-issue-89812.cFkDOE.rst https://github.com/python/cpython/pull/106337/files#diff-6c87ce11a40d94ccd49137fe61bce2cc2cdbef0dd851a3f6982142219dbac404
Please reload this pagehttps://github.com/python/cpython/pull/106337/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.