Skip to content

gh-137589: Zipfile tests: close file objects - #138080

Merged
encukou merged 2 commits into
python:mainfrom
Rogdham:zipfile-tests-close-fobj
Oct 8, 2025
Merged

encukou merged 2 commits into
python:mainfrom
Rogdham:zipfile-tests-close-fobj

Conversation

@Rogdham

@Rogdham Rogdham commented Aug 23, 2025 •

Copy link
Copy Markdown
Contributor

Some ZipFile instances were not closed in tests.

I tried to stick to the style of the tests around, to decide between using a context manager and calling .close() manually. Tell me if you want some to be changed.

See the issue for more information. I am unsure if this should be backported to 3.14 or even earlier, given the fact that it's only tests and impact has been seen only when running with PyPy.

@emmatyping

Copy link
Copy Markdown
Member

Sorry, I'll try to get to reviewing this tomorrow, been a hectic week.

@emmatyping emmatyping left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! Thank you for the fixes.

@emmatyping emmatyping added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Sep 1, 2025
@encukou
encukou merged commit 5cea843 into python:main Oct 8, 2025
43 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @Rogdham for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 8, 2025
Zipfile tests: close file objects
(cherry picked from commit 5cea843)

Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 8, 2025
Zipfile tests: close file objects
(cherry picked from commit 5cea843)

Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
@bedevere-app

bedevere-app Bot commented Oct 8, 2025

Copy link
Copy Markdown

GH-139766 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 8, 2025
@bedevere-app

bedevere-app Bot commented Oct 8, 2025

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Oct 8, 2025
vstinner pushed a commit that referenced this pull request Oct 8, 2025
)

gh-137589: Zipfile tests: close file objects (GH-138080)

Zipfile tests: close file objects
(cherry picked from commit 5cea843)

Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
vstinner pushed a commit that referenced this pull request Oct 8, 2025
)

gh-137589: Zipfile tests: close file objects (GH-138080)

Zipfile tests: close file objects
(cherry picked from commit 5cea843)

Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants