Mercurial > public > sg101
diff core/images/upload.py @ 1197:ba23e79438f4
Another attempt to write BytesIO to a file.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 07 May 2023 19:23:35 -0500 |
parents | e3a7e876aca7 |
children | 3a03c2b2df05 |
line wrap: on
line diff
--- a/core/images/upload.py Sun May 07 19:16:03 2023 -0500 +++ b/core/images/upload.py Sun May 07 19:23:35 2023 -0500 @@ -163,7 +163,8 @@ if thumb: thumb.seek(0) - shutil.copyfileobj(thumb, thumb_path) + with open(thumb_path, 'wb') as out: + out.write(thumb.getvalue()) os.chmod(thumb_path, perms) # Generate URLs for the image and thumb.