﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22971	Can't receive file with non-ascii filename according to rfc2388	homm	nobody	"Requests, popular Python library, starting from version 2.0 sends files with non-ascii characters in filename in full compliance with rfc2388:

    The original local file name may be supplied as well, either as a
    ""filename"" parameter either of the ""content-disposition: form-data""
    header or, in the case of multiple files, in a ""content-disposition:
    file"" header of the subpart. The sending application MAY supply a
    file name; if the file name of the sender's operating system is not
    in US-ASCII, the file name might be approximated, or encoded using
    the method of RFC 2231.

Where RFC 2231 defines attributes with * char. And requests uses such attribute name to send non-ascii file names.

{{{
# requests 1.2.3
>>> requests.post('http://ya.ru', files={'file': (u'файл', '123')}).request.body
--cb90e5c32429403b99966534716cda56
Content-Disposition: form-data; name=""file""; filename=""файл""
Content-Type: application/octet-stream

123
--cb90e5c32429403b99966534716cda56--


# requests 2.0
>>> requests.post('http://ya.ru', files={'file': (u'файл', '123')}).request.body
--40f2f1873ec843598773fe150b4f783a
Content-Disposition: form-data; name=""file""; filename*=utf-8''%D1%84%D0%B0%D0%B9%D0%BB

123
--40f2f1873ec843598773fe150b4f783a--
}}}

But Django doesn't recognize such files and puts raw files content in `request.POST` instead of population `request.FILES`."	Bug	closed	HTTP handling	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
