From 7daa6042a8f4b9444e5c7389f497f4637a876b7f Mon Sep 17 00:00:00 2001 From: Jared Smith Date: Thu, 18 Aug 2016 08:24:34 -0700 Subject: [PATCH] Specified which exception to catch for python-magic call failure --- ckan/lib/uploader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ckan/lib/uploader.py b/ckan/lib/uploader.py index 7465b280f49..559e501e377 100644 --- a/ckan/lib/uploader.py +++ b/ckan/lib/uploader.py @@ -177,7 +177,7 @@ def upload(self, max_size=2): try: self.mimetype = magic.from_file(filepath, mime=True) - except: + except IOError: # Not that important if call above fails self.mimetype = None @@ -284,7 +284,7 @@ def upload(self, id, max_size=10): try: self.mimetype = magic.from_file(filepath, mime=True) - except: + except IOError: # Not that important if call above fails self.mimetype = None