mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36: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)
|
||||
return im
|
||||
except (SyntaxError, IndexError, TypeError, struct.error):
|
||||
# import traceback
|
||||
# traceback.print_exc()
|
||||
pass
|
||||
logger.debug("", exc_info=True)
|
||||
|
||||
if init():
|
||||
|
||||
|
@ -2315,9 +2313,7 @@ def open(fp, mode="r"):
|
|||
_decompression_bomb_check(im.size)
|
||||
return im
|
||||
except (SyntaxError, IndexError, TypeError, struct.error):
|
||||
# import traceback
|
||||
# traceback.print_exc()
|
||||
pass
|
||||
logger.debug("", exc_info=True)
|
||||
|
||||
raise IOError("cannot identify image file %r"
|
||||
% (filename if filename else fp))
|
||||
|
|
Loading…
Reference in New Issue
Block a user