Skip to content

Conversation

Yzi-Li
Copy link
Contributor

@Yzi-Li Yzi-Li commented Aug 24, 2025

@bedevere-app bedevere-app bot added the tests Tests in the Lib/test dir label Aug 24, 2025
@Yzi-Li Yzi-Li marked this pull request as ready for review August 24, 2025 04:23
@StanFromIreland
Copy link
Member

Hello, thanks however a PR was already opened for both files yesterday, #138080.

@Yzi-Li
Copy link
Contributor Author

Yzi-Li commented Aug 24, 2025

But there are still some file objects that have not been closed in that PR.

@StanFromIreland
Copy link
Member

StanFromIreland commented Aug 24, 2025

You are closing files that should not be opened, if they are opened the test is broken anyway as the error (with assertRaises(error):) is not raised. For some other cases, when a zipfile is opened in a width block, e.g. with zipfile.ZipFile(...) as zf: it is automatically closed, you can think of it as there being an automatic finally: zf.close().

@Yzi-Li
Copy link
Contributor Author

Yzi-Li commented Aug 24, 2025

I see, thanks.

@Yzi-Li Yzi-Li deleted the close-files-in-test-core branch October 12, 2025 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants