django-sendfile icon indicating copy to clipboard operation
django-sendfile copied to clipboard

Content-Disposition: Output contains buffer repr (Python 3.4)

Open nuarhu opened this issue 9 years ago • 1 comments

With Python 3.4, the Content-Disposition created by:

sendfile(request, path, attachment=True, attachment_filename='export.zip')

django-sendfile 0.3.10 is:

attachment; filename="b'export.zip'"; filename*=UTF-8''export.zip

(The call to str.encode() now returns a byte object: https://github.com/johnsensible/django-sendfile/blob/master/sendfile/init.py#L80)

django-sendfile 0.3.9 is (desired):

'attachment; filename="export.zip"'

I have no experience with writing python 2/3 compatible code so I have not attempted to create a pull request, yet.

Thanks for your work!

nuarhu avatar Feb 12 '16 14:02 nuarhu

Hi @nuarhu and others So I have been looking at this issue and from my understanding since filenames* store quoted values and filenames* is always given priority over filename (From reading docs here) this should always be working correctly. Am I missing something here?

adnrs96 avatar Mar 14 '18 04:03 adnrs96