mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-03 13:14:27 +03:00
Ensure duplicated file pointer is closed
This commit is contained in:
parent
eff6c34bd1
commit
6e5e45a9ec
|
@ -1234,6 +1234,12 @@ class TiffImageFile(ImageFile.ImageFile):
|
|||
# UNDONE -- so much for that buffer size thing.
|
||||
n, err = decoder.decode(self.fp.read())
|
||||
|
||||
if fp:
|
||||
try:
|
||||
os.close(fp)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
self.tile = []
|
||||
self.readonly = 0
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user