8000 gh-130132: add an explicit close() call to urlopen examples without with by Mr-Sunglasses · Pull Request #130280 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 11 commits into from
Mar 18, 2025

Conversation

Mr-Sunglasses
Copy link
Contributor
@Mr-Sunglasses Mr-Sunglasses commented Feb 18, 2025

@Mr-Sunglasses
Copy link
Contributor Author

@sobolevn @picnixz ptal.

@opk12
Copy link
opk12 commented Feb 18, 2025

Thanks for correcting the missing close() bug in one example, there are 2 remaining.

@Mr-Sunglasses
Copy link
Contributor Author

Thanks for correcting the missing close() bug in one example, there are 2 remaining.

Thanks @opk12 for suggestions, added it in the remaining examples.

@Mr-Sunglasses
Copy link
Contributor Author

@sobolevn I have made the requested changes; please review again.

@bedevere-app
Copy link
bedevere-app bot commented Feb 20, 2025

Thanks for making the requested changes!

: please review the changes made to this pull request.

@Mr-Sunglasses
Copy link
Contributor Author

@sobolevn I have made the requested changes; please review again.

@bedevere-app
Copy link
bedevere-app bot commented Feb 24, 2025

Thanks for making the requested changes!

: please review the changes made to this pull request.

Copy link
Member
@sobolevn sobolevn left a 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

Mr-Sunglasses and others added 2 commits February 26, 2025 01:34
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: sobolevn <mail@sobolevn.me>
Copy link
Contributor Author
@Mr-Sunglasses Mr-Sunglasses left a 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.

@Mr-Sunglasses
Copy link
Contributor Author

Requesting @sobolevn , @picnixz for review.

@picnixz picnixz self-requested a review February 28, 2025 21:27
Copy link
Member
@picnixz picnixz left a 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.

Copy link
Contributor Author
@Mr-Sunglasses Mr-Sunglasses left a 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. 🙏🏻

@Mr-Sunglasses Mr-Sunglasses requested a review from picnixz March 9, 2025 18:20
@picnixz picnixz self-assigned this Mar 12, 2025
Other examples use `f` as the response variable.
@picnixz picnixz added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Mar 18, 2025
@picnixz picnixz enabled auto-merge (squash) March 18, 2025 09:23
@picnixz picnixz merged commit 77d2fd4 into python:main Mar 18, 2025
30 of 32 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Mar 18, 2025
@miss-islington-app
Copy link

Thanks @Mr-Sunglasses for the PR, and @picnixz for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 18, 2025
…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>
@bedevere-app
Copy link
bedevere-app bot commented Mar 18, 2025

GH-131394 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Mar 18, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 18, 2025
…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>
@bedevere-app
Copy link
bedevere-app bot commented Mar 18, 2025

GH-131395 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Mar 18, 2025
picnixz added a commit that referenced this pull request Mar 18, 2025
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>
picnixz added a commit that referenced this pull request Mar 18, 2025
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>
colesbury pushed a commit to colesbury/cpython that referenced this pull request Mar 20, 2025
…python#130280)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
…python#130280)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

docs: add an explicit close() call to urlopen examples without with
4 participants
0