Title: GH-119169: Implement `pathlib.Path.walk()` using `os.walk()` by barneygale · Pull Request #119573 · python/cpython · GitHub
Open Graph Title: GH-119169: Implement `pathlib.Path.walk()` using `os.walk()` by barneygale · Pull Request #119573 · python/cpython
X Title: GH-119169: Implement `pathlib.Path.walk()` using `os.walk()` by barneygale · Pull Request #119573 · python/cpython
Description: For silly reasons, pathlib's generic implementation of walk() currently resides in glob._Globber. This commit moves it into pathlib._abc.PathBase.walk() where it really belongs, and makes pathlib.Path.walk() call though to os.walk() rather than using the generic impl. Symlink handling is a little different between the two walk() implementations when followlinks=False. In pathlib it means never following symlinks, not even for distinguishing between files and directories. In os it means never walking into symlinks, including any symlinks created by the user between iterations. We smooth over these differences with a private sentinel - os._walk_symlinks_as_files - that enables the pathlib behaviour. No change of behaviour. Issue: gh-119169
Open Graph Description: For silly reasons, pathlib's generic implementation of walk() currently resides in glob._Globber. This commit moves it into pathlib._abc.PathBase.walk() where it really belongs, and makes pathl...
X Description: For silly reasons, pathlib's generic implementation of walk() currently resides in glob._Globber. This commit moves it into pathlib._abc.PathBase.walk() where it really belongs, and makes p...
Opengraph URL: https://github.com/python/cpython/pull/119573
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:cc72a8a0-9a5e-4347-b790-eeff4f518ccc |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B236:AA1C4:97BB27:C61582:69699340 |
| html-safe-nonce | 8710242b6d4f86951cfb0b2e79f35b41bb609490640896e303b19e9d10b41d93 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjM2OkFBMUM0Ojk3QkIyNzpDNjE1ODI6Njk2OTkzNDAiLCJ2aXNpdG9yX2lkIjoiMTgzODU1NjQzNjEwMjc0Njk0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5b3187ce50f12c18d1e9fa4dfd0c18ec354c170284f54f03a89672f642d1876a |
| hovercard-subject-tag | pull_request:1888862324 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/119573/files |
| twitter:image | https://avatars.githubusercontent.com/u/960340?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/960340?s=400&v=4 |
| og:image:alt | For silly reasons, pathlib's generic implementation of walk() currently resides in glob._Globber. This commit moves it into pathlib._abc.PathBase.walk() where it really belongs, and makes pathl... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | af80af7cc9e3de9c336f18b208a600950a3c187c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width