diff --git a/pirate/local.py b/pirate/local.py index 8163539..2169143 100644 --- a/pirate/local.py +++ b/pirate/local.py @@ -31,7 +31,9 @@ class BayParser(parser.HTMLParser): def search(db, terms): - xml = open(db).readlines() + f = open(db) + xml = f.readlines() + f.close() parser = BayParser() parser.q = (' '.join(terms)).lower() parser.feed(''.join(xml))