-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
ResourceWarning in test_robotparser #128731
Comments
serhiy-storchaka
added
type-bug
An unexpected behavior, bug, or error
tests
Tests in the Lib/test dir
stdlib
Python modules in the Lib dir
and removed
tests
Tests in the Lib/test dir
labels
Jan 11, 2025
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
Jan 11, 2025
Likhithsai2580
added a commit
to Likhithsai2580/cpython
that referenced
this issue
Jan 12, 2025
Fixes python#128731 Address ResourceWarnings in `Lib/test/test_robotparser.py` tests. * **Lib/tempfile.py** - Modify `_TemporaryFileCloser.__del__` to call `self.cleanup()` instead of `_warnings.warn`. - Add a `__del__` method to `_TemporaryFileWrapper` to ensure explicit cleanup of temporary files. * **Lib/test/test_robotparser.py** - Add a `tearDown` method to `NetworkTestCase` to explicitly close the parser. - Add a `tearDown` method to `PasswordProtectedSiteTestCase` to explicitly close the parser. - Update `PasswordProtectedSiteTestCase.testPasswordProtectedSite` to use `self.parser` instead of a local variable.
serhiy-storchaka
added a commit
that referenced
this issue
Jan 12, 2025
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jan 12, 2025
…ead() (pythonGH-128733) (cherry picked from commit 5e65a1a) Co-authored-by: Serhiy Storchaka <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jan 12, 2025
…ead() (pythonGH-128733) (cherry picked from commit 5e65a1a) Co-authored-by: Serhiy Storchaka <[email protected]>
The warning is only in the main branch, but it is better to backport this change to avoid dependency on the garbage collector. See also #128734. |
serhiy-storchaka
added a commit
that referenced
this issue
Jan 12, 2025
…otFileParser.read() (GH-128733) (GH-128756) (cherry picked from commit 5e65a1a) Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka
added a commit
that referenced
this issue
Jan 13, 2025
…otFileParser.read() (GH-128733) (GH-128755) (cherry picked from commit 5e65a1a) Co-authored-by: Serhiy Storchaka <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Linked PRs
test_robotparser
#128746The text was updated successfully, but these errors were encountered: