From 83d2b5ea37718fe8e60af36ea9c3216323ca88ed Mon Sep 17 00:00:00 2001 From: Jack Stdin Date: Sun, 14 Feb 2016 00:32:11 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=BB=D0=BE=D0=B3=D0=B8,=20fixes=20#3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aore/updater/aorar.py | 2 +- aore/updater/updater.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/aore/updater/aorar.py b/aore/updater/aorar.py index ba95561..4c6c305 100644 --- a/aore/updater/aorar.py +++ b/aore/updater/aorar.py @@ -32,7 +32,7 @@ class AoRar: except: raise FiasException("Error downloading. Reason : {}".format(format_exc())) - logging.info("Downloaded %d bytes", request.headers['Content-length']) + logging.info("Downloaded %d bytes", int(request.headers['Content-length'])) return local_filename def get_table_entries(self, file_name, allowed_tables): diff --git a/aore/updater/updater.py b/aore/updater/updater.py index 35bc40e..a99f238 100644 --- a/aore/updater/updater.py +++ b/aore/updater/updater.py @@ -39,6 +39,8 @@ class Updater: rows = db.get_rows('SELECT version FROM "CONFIG" WHERE id=0', True) assert len(rows) > 0, "Cannot get a version" return rows[0]['version'] + except: + return 0 finally: db.close()