Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-89727: Fix pathlib.Path.walk RecursionError on deep trees#100282
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
gh-89727: Fix pathlib.Path.walk RecursionError on deep trees#100282
Uh oh!
There was an error while loading.Please reload this page.
Conversation
netlifybot commentedDec 15, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview forpython-cpython-preview canceled.
|
zmievsa commentedDec 15, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
TODO:
Update: |
…f github.com:ovsyanka83/cpython intopythongh-89727/fix-pathlib.Path.walk-recursion-depth
/cc@barneygale |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM. I assume because of the initial underscore we don't have to worry about people who may have subclassedPath and overridden the_walk method (now to no effect.)
@carljm remember that Path.walk has only been created in 3.12 which means that 99% of libraries/projects do not and cannot depend on it yet. |
@barneygale any estimates of when you will have time to take a look at it? No pressure or rush though. |
I'll look at this within the next few days! |
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Barney Gale <barney.gale@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks good to me!
@AlexWaygood what would be the next steps for this PR? I am ready to continue improving it |
Sorry@Ovsyanka83, I'll try to take a proper look soon! |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Brett Cannon <brett@python.org>
barneygale commentedFeb 1, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@AlexWaygood gentle nudge to review this when you have the time! Thanks :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM.
Thanks for your contribution.
Uh oh!
There was an error while loading.Please reload this page.
@barneygale thanks! Wow. Have you received merge rights? Congrats! Did they make you a core developer or is that a special rule just for you and pathlib? |
We made him a core dev!https://discuss.python.org/t/vote-to-promote-barney-gale/24801 |
@Ovsyanka83 thanks for your patience and for working on this, it's a neat patch :). I'm hoping to build an iterative version of |
…ythonGH-100282)Use a stack to implement `pathlib.Path.walk()` iteratively instead of recursively to avoid hitting recursion limits on deeply nested trees.Co-authored-by: Barney Gale <barney.gale@gmail.com>Co-authored-by: Brett Cannon <brett@python.org>
…ythonGH-100282)Use a stack to implement `pathlib.Path.walk()` iteratively instead of recursively to avoid hitting recursion limits on deeply nested trees.Co-authored-by: Barney Gale <barney.gale@gmail.com>Co-authored-by: Brett Cannon <brett@python.org>
Use `Path.walk()` to implement the recursive wildcard `**`. This methoduses an iterative (rather than recursive) walk - seepythonGH-100282.
Use `Path.walk()` to implement the recursive wildcard `**`. This methoduses an iterative (rather than recursive) walk - seeGH-100282.
Uh oh!
There was an error while loading.Please reload this page.
Use a stack to implement pathlib.Path.walk iteratively instead of recursively to avoid hitting recursion limits on deeply nested trees.