mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
Merge pull request #5946 from radarhere/file_pointer
Ensure duplicated file pointer is closed
This commit is contained in:
commit
ac7f42c2c6
|
@ -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