Skip to content

Conversation

Rogdham
Copy link
Contributor

@Rogdham Rogdham commented Aug 23, 2025

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
Member

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

Copy link
Member

@emmatyping emmatyping left a comment

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 bugs and 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

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 <[email protected]>
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 <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Oct 8, 2025

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
Copy link

bedevere-app bot commented Oct 8, 2025

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 bugs and 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 <[email protected]>
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 <[email protected]>
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