Closed
Description
Bug report
$ ./python -We -m test -vuall test_robotparser
...
test_read_404 (test.test_robotparser.NetworkTestCase.test_read_404) ... Warning -- Unraisable exception
Exception ignored in: <function _TemporaryFileCloser.__del__ at 0x7ff389434dd0>
Traceback (most recent call last):
File "/home/serhiy/py/cpython/Lib/tempfile.py", line 483, in __del__
_warnings.warn(self.warn_message, ResourceWarning)
ResourceWarning: Implicitly cleaning up <HTTPError 404: 'Not Found'>
ok
testPasswordProtectedSite (test.test_robotparser.PasswordProtectedSiteTestCase.testPasswordProtectedSite) ... Warning -- Unraisable exception
Exception ignored in: <function _TemporaryFileCloser.__del__ at 0x7ff389434dd0>
Traceback (most recent call last):
File "/home/serhiy/py/cpython/Lib/tempfile.py", line 483, in __del__
_warnings.warn(self.warn_message, ResourceWarning)
ResourceWarning: Implicitly cleaning up <HTTPError 403: 'Forbidden access'>
ok
...
Linked PRs
- gh-128731: Fix ResourceWarning in robotparser.RobotFileParser.read() #128733
- gh-128731: fix ResourceWarning in
test_robotparser
#128746 - [3.13] gh-128731: Explicitly close socket on error in robotparser.RobotFileParser.read() (GH-128733) #128755
- [3.12] gh-128731: Explicitly close socket on error in robotparser.RobotFileParser.read() (GH-128733) #128756