Title: GH-119169: Skip reversing sibling directories in `os.[f]walk(topdown=False)` by barneygale · Pull Request #119473 · python/cpython · GitHub
Open Graph Title: GH-119169: Skip reversing sibling directories in `os.[f]walk(topdown=False)` by barneygale · Pull Request #119473 · python/cpython
X Title: GH-119169: Skip reversing sibling directories in `os.[f]walk(topdown=False)` by barneygale · Pull Request #119473 · python/cpython
Description: In os.walk(topdown=False), don't bother reversing walk_dirs. This means that sibling directories are visited in a different order, but 1) that order is arbitrary and comes from os.scandir(), and 2) unlike in top-down mode, users can't influence which directories are visited or in what order. This change caused test_walk_bottom_up to fail. I think this test made assertions that were too specific and relied on os.scandir() returning things in a specific order. The test code is pretty hard to understand once you get into the details. I've replaced it with a version of the same test from test_pathlib_abc.py. The new test checks that every directory is yielded before all its ancestors, and after all its descendants, but does not check the order of its yielded siblings. Issue: gh-119169
Open Graph Description: In os.walk(topdown=False), don't bother reversing walk_dirs. This means that sibling directories are visited in a different order, but 1) that order is arbitrary and comes from os.scandir(), an...
X Description: In os.walk(topdown=False), don't bother reversing walk_dirs. This means that sibling directories are visited in a different order, but 1) that order is arbitrary and comes from os.scandir()...
Opengraph URL: https://github.com/python/cpython/pull/119473
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:2e5d7112-e52a-158a-a730-3bfff532f5b5 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E75A:3244AB:31ACCE:42C186:69697B70 |
| html-safe-nonce | b31f71d4571da5a8631859ae5378b4b7192e4d80b1dd28d33d7180cc60b1c379 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzVBOjMyNDRBQjozMUFDQ0U6NDJDMTg2OjY5Njk3QjcwIiwidmlzaXRvcl9pZCI6Ijg4MDM0NTMxMzMzMzgwMTY2MjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2a42a3238d53731063295b840e25663092413ea38ac0ca4b7f82c39352608530 |
| hovercard-subject-tag | pull_request:1885285162 |
| 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/119473/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 | In os.walk(topdown=False), don't bother reversing walk_dirs. This means that sibling directories are visited in a different order, but 1) that order is arbitrary and comes from os.scandir(), an... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | f33e4b94c8824ab2b434d82a94139432fb5ebee9df4b75304140ad22508c4a77 |
| 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 | 48f380098b30acbb700b04f1724481ca10d574fc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width