From 9ce15336f7969a5a32eb8fe7e8996a953eaa4eb2 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 22 Dec 2007 16:59:28 +0000 Subject: [PATCH] Always close the input file. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@123 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- Robots/parse_html_beautifulsoup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: -- 2.39.5