mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Also log plugin opening failures.
This allows obtaining tracebacks of failures by plugins to open files by setting the log-level to DEBUG, rather than by having to uncomment the "traceback.print_exc" lines in Image.open.
This commit is contained in:
parent
4e754e9c55
commit
983c4602b5
|
@ -2300,9 +2300,7 @@ def open(fp, mode="r"):
|
||||||
_decompression_bomb_check(im.size)
|
_decompression_bomb_check(im.size)
|
||||||
return im
|
return im
|
||||||
except (SyntaxError, IndexError, TypeError, struct.error):
|
except (SyntaxError, IndexError, TypeError, struct.error):
|
||||||
# import traceback
|
logger.debug("", exc_info=True)
|
||||||
# traceback.print_exc()
|
|
||||||
pass
|
|
||||||
|
|
||||||
if init():
|
if init():
|
||||||
|
|
||||||
|
@ -2315,9 +2313,7 @@ def open(fp, mode="r"):
|
||||||
_decompression_bomb_check(im.size)
|
_decompression_bomb_check(im.size)
|
||||||
return im
|
return im
|
||||||
except (SyntaxError, IndexError, TypeError, struct.error):
|
except (SyntaxError, IndexError, TypeError, struct.error):
|
||||||
# import traceback
|
logger.debug("", exc_info=True)
|
||||||
# traceback.print_exc()
|
|
||||||
pass
|
|
||||||
|
|
||||||
raise IOError("cannot identify image file %r"
|
raise IOError("cannot identify image file %r"
|
||||||
% (filename if filename else fp))
|
% (filename if filename else fp))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user