Skip to content

Commit

Permalink
gh-128731: Fix ResourceWarning in robotparser.RobotFileParser.read()
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka committed Jan 11, 2025
1 parent 3a570c6 commit 6af6fcc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions Lib/urllib/robotparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def read(self):
self.disallow_all = True
elif err.code >= 400 and err.code < 500:
self.allow_all = True
err.close()
else:
raw = f.read()
self.parse(raw.decode("utf-8").splitlines())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix ResourceWarning in :meth:`robotparser.RobotFileParser.read`.

0 comments on commit 6af6fcc

Please sign in to comment.