From: Rob Browning Date: Wed, 14 May 2014 17:01:10 +0000 (-0500) Subject: Initialize MetaStoreWriter self._file to None X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=030121915d53399f84a19bcdfc4951a72d38d3e1;p=packages%2Fb%2Fbup.git Initialize MetaStoreWriter self._file to None Without this, if something goes wrong in the constructor self._file may not be initialized, which causes close(), invoked via __del__(), to crash. Thanks to Fabian Bakkum for reporting the problem. Signed-off-by: Rob Browning --- diff --git a/lib/bup/index.py b/lib/bup/index.py index 4aec5c7..b99e6d3 100644 --- a/lib/bup/index.py +++ b/lib/bup/index.py @@ -53,6 +53,7 @@ class MetaStoreWriter: # Map metadata hashes to bupindex.meta offsets. self._offsets = {} self._filename = filename + self._file = None # FIXME: see how slow this is; does it matter? m_file = open(filename, 'ab+') try: