From 4a8b22a616dc1249125e175b1e4106593823ec29 Mon Sep 17 00:00:00 2001 From: evilhero Date: Wed, 17 Oct 2012 11:57:51 -0400 Subject: [PATCH] Fix for OSError issues when adding comics --- mylar/importer.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/mylar/importer.py b/mylar/importer.py index bea12f3e..fd10740a 100755 --- a/mylar/importer.py +++ b/mylar/importer.py @@ -133,9 +133,8 @@ def addComictoDB(comicid,mismatch=None): try: os.makedirs(str(comlocation)) logger.info(u"Directory successfully created at: " + str(comlocation)) - except OSError.e: - if e.errno != errno.EEXIST: - raise + except OSError: + logger.error(u"Could not create comicdir : " + str(comlocation)) #try to account for CV not updating new issues as fast as GCD #seems CV doesn't update total counts @@ -153,9 +152,8 @@ def addComictoDB(comicid,mismatch=None): os.makedirs(str(mylar.CACHE_DIR)) logger.info(u"Cache Directory successfully created at: " + str(mylar.CACHE_DIR)) - except OSError.e: - if e.errno != errno.EEXIST: - raise + except OSError: + logger.error('Could not create cache dir. Check permissions of cache dir: ' + str(mylar.CACHE_DIR)) coverfile = mylar.CACHE_DIR + "/" + str(comicid) + ".jpg" @@ -430,9 +428,9 @@ def GCDimport(gcomicid): try: os.makedirs(str(comlocation)) logger.info(u"Directory successfully created at: " + str(comlocation)) - except OSError.e: - if e.errno != errno.EEXIST: - raise + except OSError: + logger.error(u"Could not create comicdir : " + str(comlocation)) + comicIssues = gcdinfo['totalissues'] @@ -444,9 +442,8 @@ def GCDimport(gcomicid): os.makedirs(str(mylar.CACHE_DIR)) logger.info(u"Cache Directory successfully created at: " + str(mylar.CACHE_DIR)) - except OSError.e: - if e.errno != errno.EEXIST: - raise + except OSError: + logger.error(u"Could not create cache dir : " + str(mylar.CACHE_DIR)) coverfile = mylar.CACHE_DIR + "/" + str(gcomicid) + ".jpg"