Opened 4 years ago

Closed 4 years ago

#31995 closed Bug (needsinfo)

Unnecesarry quotes are created by TemporaryUploadedFile.

Reported by: jehat armanç deniz Owned by: nobody
Component: File uploads/storage Version: 3.1
Severity: Normal Keywords:
Cc: Carlton Gibson Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

_, ext = os.path.splitext(name) this line rarely creates extensions like ' mp4" ' according to name of file

It puts one more unnecessary quote and causes errors in some complex named videos

i recommend to use ext = ext.replace('"', "") this line to fix after that line

Attachments (3)

errors.PNG (123.8 KB ) - added by jehat armanç deniz 4 years ago.
this file is showing errors raised after post request we throw
error.PNG (49.8 KB ) - added by jehat armanç deniz 4 years ago.
creates file urls like that
fix.PNG (49.0 KB ) - added by jehat armanç deniz 4 years ago.
detailed

Download all attachments as: .zip

Change History (5)

by jehat armanç deniz, 4 years ago

Attachment: errors.PNG added

this file is showing errors raised after post request we throw

comment:1 by jehat armanç deniz, 4 years ago

Summary: while uploading file it creates an unnecesarry quotewhile uploading file it creates an unnecesarry quote in uploadedfile.py/temporaryfileuploadedfile __init__

by jehat armanç deniz, 4 years ago

Attachment: error.PNG added

creates file urls like that

by jehat armanç deniz, 4 years ago

Attachment: fix.PNG added

detailed

comment:2 by Mariusz Felisiak, 4 years ago

Cc: Carlton Gibson added
Resolution: needsinfo
Status: newclosed
Summary: while uploading file it creates an unnecesarry quote in uploadedfile.py/temporaryfileuploadedfile __init__Unnecesarry quotes are created by TemporaryUploadedFile.

As far as I'm aware TemporaryUploadedFile should receive an unquoted filename, so the main question is why quoted name was passed. It looks that you're using Django 2.2 (which doesn't receive bugfixes anymore), can you reproduce this issue with Django 3.1? It can also be an issue in DRF, can you reproduce it without DRF?

Note: See TracTickets for help on using tickets.
Back to Top