[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2

2015-03-29 Thread Donald Stufft
Changes by Donald Stufft : -- stage: -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2

2015-03-29 Thread Donald Stufft
Donald Stufft added the comment: Thanks everyone for taking a look at this! -- stage: resolved -> ___ Python tracker ___ ___ Python-b

[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2

2015-03-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset b9364903d91c by Benjamin Peterson in branch 'default': merge 3.4 (#23801) https://hg.python.org/cpython/rev/b9364903d91c -- ___ Python tracker

[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2

2015-03-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3af77d1c5c47 by Donald Stufft in branch '3.4': Closes #23801 - Ignore entire preamble to multipart in cgi.FieldStorage https://hg.python.org/cpython/rev/3af77d1c5c47 -- nosy: +python-dev resolution: -> fixed stage: -> resolved status: open

[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2

2015-03-29 Thread Benjamin Peterson
Benjamin Peterson added the comment: Oh, I see. I think your way is fine then. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2

2015-03-29 Thread Donald Stufft
Donald Stufft added the comment: @Benjamin The reason I didn't do that to begin with, was the code currently checks if the first line is a bytes object or not in order to be able to raise an error if it's returning str instead of bytes. I didn't want to redo that check on every iteration, so

[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2

2015-03-29 Thread R. David Murray
R. David Murray added the comment: The code you are modifying looks completely wrong-headed to me. Unfortunately I don't have time to rewrite the cgi module right now :). Given that, your fix looks fine: the first part of a multipart (up to the first inner boundary) is the 'preamble', which

[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2

2015-03-29 Thread Benjamin Peterson
Benjamin Peterson added the comment: The loop might be more elegantly expressed as for line in self.fp: self.bytes_read += len(line) if line.strip() != b"--" + self.innerboundary: break but otherwise lgtm -- nosy: +benjamin.peterson

[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2

2015-03-29 Thread Donald Stufft
Donald Stufft added the comment: Also adding Berker Peksag because they've touched this module recently :) -- nosy: +berker.peksag ___ Python tracker ___

[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2

2015-03-29 Thread Donald Stufft
Donald Stufft added the comment: Added R David Murray to the nosy list because this is kinda similar to the email stuff and there doesn't seem to be anyone better to look at this patch that I can find... -- nosy: +r.david.murray ___ Python tracker

[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2

2015-03-28 Thread Donald Stufft
Donald Stufft added the comment: Added a patch that fixes this issue by reading lines until we find the line that is our expected boundary marker. -- keywords: +patch Added file: http://bugs.python.org/file38722/cgi-read-until-boundary.diff ___ Pytho

[issue23801] cgi.FieldStorage has different (wrong?) behavior on Python3 than Python2

2015-03-28 Thread Donald Stufft
New submission from Donald Stufft: While working on PyPI 2.0 (which is currently running Python 3) I discovered that ``setup.py upload`` was causing an exception. After tracing things I determined that the reason for this is that Python 3 fails to handle leading whitespace in a multipart body.