misc: close file pointer in get_thumbnail (#75505)

This commit is contained in:
Benjamin Dauvergne 2023-03-20 17:08:34 +01:00 committed by Gitea
parent bd2118ed9d
commit 91372fae5d
1 changed files with 2 additions and 0 deletions

View File

@ -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: