BUG=skia:2247
NOTREECHECKS=True
NOTRY=True
R=borenet@google.com
Author: epoger@google.com
Review URL: https://codereview.chromium.org/
211733004
git-svn-id: http://skia.googlecode.com/svn/trunk@13951
2bbb7eff-a529-9590-31e7-
b0007b416f81
try:
return Image.open(filepath)
except IOError:
- logging.error('IOError loading image file %s' % filepath)
+ # If we are unable to load an image from the file, delete it from disk
+ # and we will try to fetch it again next time. Fixes http://skbug.com/2247
+ logging.error('IOError loading image file %s ; deleting it.' % filepath)
+ os.remove(filepath)
raise