-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-130132: add an explicit close() call to urlopen examples without with #130280
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
Thanks for correcting the missing close() bug in one example, there are 2 remaining. |
Thanks @opk12 for suggestions, added it in the remaining examples. |
@sobolevn I have made the requested changes; please review again. |
Thanks for making the requested changes! : please review the changes made to this pull request. |
@sobolevn I have made the requested changes; please review again. |
Thanks for making the requested changes! : please review the changes made to this pull request. |
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.
let's use 4 spaces
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: sobolevn <mail@sobolevn.me>
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.
@sobolevn I have made the requested changes; please review again.
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.
There are some usages of opener.open
(L1319, L1340) that could be in a "with". Please check the entire file with occurrences of open
and urlopen
. TiA.
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.
@picnixz I've make the requested changes. please review again 😄 .
TiA. 🙏🏻
Other examples use `f` as the response variable.
Thanks @Mr-Sunglasses for the PR, and @picnixz for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
…pythonGH-130280) (cherry picked from commit 77d2fd4) Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com> Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
GH-131394 is a backport of this pull request to the 3.13 branch. |
…pythonGH-130280) (cherry picked from commit 77d2fd4) Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com> Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
GH-131395 is a backport of this pull request to the 3.12 branch. |
GH-130280) (#131394) gh-130132: properly free resources in `urrlib.urlopen` examples (GH-130280) (cherry picked from commit 77d2fd4) Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com> Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
GH-130280) (#131395) gh-130132: properly free resources in `urrlib.urlopen` examples (GH-130280) (cherry picked from commit 77d2fd4) Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com> Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
…python#130280) Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
…python#130280) Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
fix: #130132
close()
call tourlopen
examples withoutwith
#130132📚 Documentation preview 📚: https://cpython-previews--130280.org.readthedocs.build/