From: Oleg Broytman Date: Sat, 22 Dec 2007 16:59:28 +0000 (+0000) Subject: Always close the input file. X-Git-Tag: v4.5.3~253 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=9ce15336f7969a5a32eb8fe7e8996a953eaa4eb2;p=bookmarks_db.git Always close the input file. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@123 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- diff --git a/Robots/parse_html_beautifulsoup.py b/Robots/parse_html_beautifulsoup.py index 5f010ad..d73e4c3 100644 --- a/Robots/parse_html_beautifulsoup.py +++ b/Robots/parse_html_beautifulsoup.py @@ -55,7 +55,8 @@ def parse_html(filename, charset=None): root = BadDeclParser(infile, fromEncoding=charset) except TypeError: return None - infile.close() + finally: + infile.close() _charset = root.originalEncoding try: