misc: close file pointer in get_thumbnail (#75505)
This commit is contained in:
parent
bd2118ed9d
commit
91372fae5d
|
@ -767,6 +767,8 @@ def get_thumbnail(filepath, content_type=None):
|
|||
except OSError:
|
||||
# failed to create thumbnail.
|
||||
raise ThumbnailError()
|
||||
finally:
|
||||
fp.close()
|
||||
|
||||
# store thumbnail
|
||||
with open(thumb_filepath, 'wb') as f:
|
||||
|
|
Loading…
Reference in New Issue