mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 03:54:58 -04:00
Don't close file prematurely
This commit is contained in:
parent
e283b555b1
commit
802ca12d05
2 changed files with 18 additions and 8 deletions
|
@ -275,8 +275,8 @@ class PreviewUrlResource(Resource):
|
|||
)
|
||||
# FIXME: pass through 404s and other error messages nicely
|
||||
|
||||
with open(fname) as f:
|
||||
yield self.media_repo.copy_to_backup(f, fpath)
|
||||
# Will close the file after its done
|
||||
yield self.media_repo.copy_to_backup(open(fname), fpath)
|
||||
|
||||
media_type = headers["Content-Type"][0]
|
||||
time_now_ms = self.clock.time_msec()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue