Re: [Python-Dev] cgi.FieldStorage with multipart/form-data tries to decode binary file as UTF-8 if "filename=" not specified

2017-02-15 Thread Ben Hoyt
That's reasonable. This isn't an issue on Python 2.x because everything is handled as bytes (str on 2.x). It looks like cgi.FieldStorage() only got Unicode support in Python 3.x at all fairly "late" in the game, for 3.2 or 3.3. It was in that commit (https://github.com/python/cpy thon/commit/5c23b8

Re: [Python-Dev] cgi.FieldStorage with multipart/form-data tries to decode binary file as UTF-8 if "filename=" not specified

2017-02-15 Thread Brett Cannon
On Wed, 15 Feb 2017 at 08:14 Ben Hoyt wrote: > I posted this on StackOverflow [1], but I'm posting it here as well, as I > believe this is a bug (or at least quirk) in cgi.FieldStorage where you > can't access a file upload properly if "filename=" is not present in the > MIME part's Content-Dispo

[Python-Dev] cgi.FieldStorage with multipart/form-data tries to decode binary file as UTF-8 if "filename=" not specified

2017-02-15 Thread Ben Hoyt
I posted this on StackOverflow [1], but I'm posting it here as well, as I believe this is a bug (or at least quirk) in cgi.FieldStorage where you can't access a file upload properly if "filename=" is not present in the MIME part's Content-Disposition header. There are a couple of related bugs open