-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-126055: Add omitted command (in docs [os.walk]) for code to fulfill shutil.rmtree
algorithm
#126067
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…fulfill `shutil.rmtree` algorithm. Resolves python#126055
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.
Thanks for the clean PR!
This is one of the possible patches. Another possibility is to just mention that we are walking bottom-up but only mention that this is what shutil.rmtree
needs to do.
The example is already dangerous as it is so I don't think it's an issue to also add the os.rmdir(top)
in the example (I mean... you'd either end up with an empty directory or... no directory at all which, if you made a mistake, doesn't matter at that point).
cc @ncoghlan @barneygale as docs and pathlib experts (I don't have commit privileges so I cannot merge this PR).
I'm honored:
It happens that before I saw that section in the documentation, I had been playing with That said -- HELLO! I'm honored to be in touch with you. :-) |
@picnixz FYI, I just recently helped to untangle the first half of the LVGL library documentation, and am now in a big proofreading sequence to make it more friendly (I don't mind calling it Queen's English) to native-English C programmers. By the way, I just saw the "This branch is out-of-date with the base branch" message come up. Do I need to rebase it on top of |
No need for that. We only rebase it if 1) there are conflicts that need to be fixed 2) to make the CI green if a fix has been pushed on
If you find any typos in Python documentation or if there are sentences that need to be improved, you're always welcome to make a PR out of it! or you can have a look at https://discuss.python.org/c/documentation/26 where the docs community discuss (maybe you can help them out there). |
Okay! I'm glad I asked. I had the impression that message indicating the merge was being blocked, but I am glad it isn't.
I'm honored! Thank you! I did find some real usability issues, but I believe it is really part of the design of the navigation-panel generation of the Also: thank you for the link to the Python docs group! I'm checking it out now. I haven't yet dived into how Sphinx themes work, but... I'm a 32-year veteran software developer (been working mostly in automotive firmware, close to the CPU [and supporting software] for the last 13 years), I'm a C master [+C#, VB.NET, optimization], heavily O-O trained (design & coding, by Bertrand Meyer himself [directly and indirectly]), and have been really enjoying learning Python lately. I'm also looking for paid work, in case you're aware of any opportunities that might be a good match for my skill set. That said, with all that behind me, Sphinx themes should be a blast! 😄 |
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.
Thanks @vwheeler63 for the PR. And congrats for the first commit!
Nice work @picnixz coaching on the PR and its review.
I'm honored, Carol! **...and envious of your sphere of responsibility!** 😈 😃 👋 |
Thanks @vwheeler63 for the PR, and @willingc for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
…fulfill `shutil.rmtree` algorithm (pythonGH-126067) * pythongh-126055: Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtree` algorithm. Resolves pythonGH-126055 * pythongh-126055: Fix omitted code highlighting (cherry picked from commit 597d814) Co-authored-by: Victor Wheeler <[email protected]>
…fulfill `shutil.rmtree` algorithm (pythonGH-126067) * pythongh-126055: Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtree` algorithm. Resolves pythonGH-126055 * pythongh-126055: Fix omitted code highlighting (cherry picked from commit 597d814) Co-authored-by: Victor Wheeler <[email protected]>
GH-126199 is a backport of this pull request to the 3.13 branch. |
GH-126200 is a backport of this pull request to the 3.12 branch. |
I love the Monty Python references by the bot-apps.... 😃 |
… fulfill `shutil.rmtree` algorithm (GH-126067) (GH-126200) gh-126055: Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtree` algorithm (GH-126067) * gh-126055: Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtree` algorithm. Resolves GH-126055 * gh-126055: Fix omitted code highlighting (cherry picked from commit 597d814) Co-authored-by: Victor Wheeler <[email protected]>
… fulfill `shutil.rmtree` algorithm (GH-126067) (GH-126199) gh-126055: Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtree` algorithm (GH-126067) * gh-126055: Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtree` algorithm. Resolves GH-126055 * gh-126055: Fix omitted code highlighting (cherry picked from commit 597d814) Co-authored-by: Victor Wheeler <[email protected]>
…fulfill `shutil.rmtree` algorithm (pythonGH-126067) * pythongh-126055: Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtree` algorithm. Resolves python#126055 * pythongh-126055: Fix omitted code highlighting
…fulfill `shutil.rmtree` algorithm (pythonGH-126067) * pythongh-126055: Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtree` algorithm. Resolves python#126055 * pythongh-126055: Fix omitted code highlighting
In
./Doc/library/os.rst
, the section documentingos.walk()
gives a code example at the bottom that says it is "a simple implementation of shutil.rmtree()". However it is incomplete. Reason: shutil.rmtree() also removes the passed directory whereas the code shown will not. This PR adds the last missing command to complete the algorithm and make the statement correct.Resolves #126055
📚 Documentation preview 📚: https://cpython-previews--126067.org.readthedocs.build/