From 20b3831862a459a00a2fe1b1302b4ec760916d49 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 29 Mar 2021 11:03:12 +0200 Subject: [PATCH] don't fail if getsize fails on tmp file --- pandora/item/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora/item/views.py b/pandora/item/views.py index 7ad11572..62c6b21a 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -1030,7 +1030,10 @@ def download(request, id, resolution=None, format='webm', part=None): return HttpResponseForbidden() elif r is True: response = HttpResponse(FileWrapper(video), content_type=content_type) - response['Content-Length'] = os.path.getsize(video.name) + try: + response['Content-Length'] = os.path.getsize(video.name) + except: + pass else: response = HttpFileResponse(r, content_type=content_type) else: