The OSError doesn't like unicode text, change it to plain Exception class (Sergei Glita)

This commit is contained in:
Roberto Rosario
2012-02-11 20:05:02 -04:00
parent afb64f7472
commit 028c134bfd

View File

@@ -41,7 +41,7 @@ def get_all_files(path):
try:
return sorted([os.path.normcase(f) for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))])
except OSError, exc:
raise OSError(ugettext(u'Unable get list of staging files: %s') % exc)
raise Exception(ugettext(u'Unable get list of staging files: %s') % exc)
def _return_new_class():
@@ -136,7 +136,7 @@ class StagingFile(object):
if exc.errno == errno.ENOENT:
pass
else:
raise OSError(ugettext(u'Unable to delete staging file: %s') % exc)
raise Exception(ugettext(u'Unable to delete staging file: %s') % exc)
def get_valid_image(self, size=THUMBNAIL_SIZE, transformations=None):
return convert(self.filepath, size=size, cleanup_files=False, transformations=transformations)