Review existing comments and add new ones

Also clarified a statement
This commit is contained in:
JoeLametta
2019-01-17 11:25:16 +00:00
parent fe36241730
commit cf923cc9cc
11 changed files with 18 additions and 5 deletions

View File

@@ -104,8 +104,8 @@ class Persister:
try:
self.object = pickle.load(handle)
logger.debug('loaded persisted object from %r', self._path)
# FIXME: catching too general exception (Exception)
except Exception as e:
# TODO: restrict kind of caught exceptions?
# can fail for various reasons; in that case, pretend we didn't
# load it
logger.debug(e)
@@ -127,7 +127,7 @@ class PersistedCache:
try:
os.makedirs(self.path)
except OSError as e:
if e.errno != 17: # FIXME
if e.errno != os.errno.EEXIST: # FIXME: errno 17 is 'File Exists'
raise
def _getPath(self, key):

View File

@@ -297,6 +297,7 @@ class Program:
print('Type : %s' % metadata.releaseType)
if metadata.barcode:
print("Barcode : %s" % metadata.barcode)
# TODO: Add test for non ASCII catalog numbers: see issue #215
if metadata.catalogNumber:
print("Cat no : %s" %
metadata.catalogNumber.encode('utf-8'))

View File

@@ -87,6 +87,7 @@ class PopenTask(task.Task):
return
self._done()
# FIXME: catching too general exception (Exception)
except Exception as e:
logger.debug('exception during _read(): %s', e)
self.setException(e)