Explicitly close url file to avoid ResourceWarning in Python 3.14#605
Closed
iwanb wants to merge 1 commit into
Closed
Explicitly close url file to avoid ResourceWarning in Python 3.14#605iwanb wants to merge 1 commit into
iwanb wants to merge 1 commit into
Conversation
thunze
added a commit
to thunze/nixpkgs
that referenced
this pull request
Mar 21, 2026
thunze
added a commit
to thunze/nixpkgs
that referenced
this pull request
Mar 21, 2026
13 tasks
mistotebe
requested changes
May 6, 2026
mistotebe
left a comment
Contributor
There was a problem hiding this comment.
Hi thanks for the patch, can you do the same in LDIFParser in ldif.py?
Contributor
I could do it in a separate merge request, if that's faster than waiting for somebody else, if you want. |
Contributor
|
→ here you go: #610 |
Contributor
|
Closed via 7ab1fa9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
urlopenopens a file, when it's not closed explicitly it creates the following warning (at least with Python 3.14):This makes the test suite fail if pytest has strict warning checks.
I found this through this build failure for the NixOS python-ldap package with Python 3.14: https://hydra.nixos.org/build/318165407/nixlog/2
See also NixOS/nixpkgs#475732