Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Conversation

@zmievsa
Copy link
Contributor

@zmievsazmievsa commentedDec 15, 2022
edited
Loading

Use a stack to implement pathlib.Path.walk iteratively instead of recursively to avoid hitting recursion limits on deeply nested trees.

wimglenn reacted with thumbs up emojijonburdo and barneygale reacted with heart emoji
@netlify
Copy link

netlifybot commentedDec 15, 2022
edited
Loading

Deploy Preview forpython-cpython-preview canceled.

NameLink
🔨 Latest commit2bfc47d
🔍 Latest deploy loghttps://app.netlify.com/sites/python-cpython-preview/deploys/639c50140be628000884140d

@zmievsa
Copy link
ContributorAuthor

zmievsa commentedDec 15, 2022
edited
Loading

TODO:

  • Add a news blip
  • Add a test that checks for deeply nested directories
  • Figure out a better name for is_result

Update:
All done!

@zmievsazmievsa marked this pull request as ready for reviewDecember 16, 2022 10:32
@brettcannon
Copy link
Member

/cc@barneygale

Copy link
Member

@carljmcarljm left a 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.)

zmievsa reacted with hooray emoji
@zmievsa
Copy link
ContributorAuthor

@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.

carljm reacted with thumbs up emoji

@zmievsa
Copy link
ContributorAuthor

@barneygale any estimates of when you will have time to take a look at it? No pressure or rush though.

@barneygale
Copy link
Contributor

I'll look at this within the next few days!

zmievsa reacted with thumbs up emoji

Co-authored-by: Barney Gale <barney.gale@gmail.com>
Copy link
Contributor

@barneygalebarneygale left a 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!

@zmievsa
Copy link
ContributorAuthor

@AlexWaygood what would be the next steps for this PR? I am ready to continue improving it

@AlexWaygood
Copy link
Member

Sorry@Ovsyanka83, I'll try to take a proper look soon!

zmievsa reacted with rocket emoji

Co-authored-by: Brett Cannon <brett@python.org>
@barneygale
Copy link
Contributor

barneygale commentedFeb 1, 2023
edited
Loading

@AlexWaygood gentle nudge to review this when you have the time! Thanks :)

zmievsa reacted with heart emoji

Copy link
Member

@CuriousLearnerCuriousLearner left a 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.

@barneygale
Copy link
Contributor

@barneygalebarneygale merged commit713df2c intopython:mainMar 22, 2023
@zmievsa
Copy link
ContributorAuthor

@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?

@zmievsazmievsa deleted the gh-89727/fix-pathlib.Path.walk-recursion-depth branchMarch 22, 2023 18:20
@AlexWaygood
Copy link
Member

We made him a core dev!https://discuss.python.org/t/vote-to-promote-barney-gale/24801

zmievsa reacted with hooray emojizmievsa reacted with heart emoji

@barneygale
Copy link
Contributor

@Ovsyanka83 thanks for your patience and for working on this, it's a neat patch :). I'm hoping to build an iterative version ofglob() atop!

Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this pull requestMar 27, 2023
…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>
warsaw pushed a commit to warsaw/cpython that referenced this pull requestApr 11, 2023
…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>
barneygale added a commit to barneygale/cpython that referenced this pull requestMay 11, 2023
Use `Path.walk()` to implement the recursive wildcard `**`. This methoduses an iterative (rather than recursive) walk - seepythonGH-100282.
barneygale added a commit that referenced this pull requestMay 15, 2023
Use `Path.walk()` to implement the recursive wildcard `**`. This methoduses an iterative (rather than recursive) walk - seeGH-100282.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@brettcannonbrettcannonbrettcannon approved these changes

@carljmcarljmcarljm approved these changes

@barneygalebarneygalebarneygale approved these changes

@CuriousLearnerCuriousLearnerCuriousLearner approved these changes

@serhiy-storchakaserhiy-storchakaAwaiting requested review from serhiy-storchaka

@AlexWaygoodAlexWaygoodAwaiting requested review from AlexWaygood

+1 more reviewer

@kalvdanskalvdanskalvdans left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

9 participants

@zmievsa@brettcannon@barneygale@AlexWaygood@carljm@kalvdans@CuriousLearner@bedevere-bot@Ovsyanka83

[8]ページ先頭

©2009-2025 Movatter.jp