[ python-Bugs-1540529 ] cgi.py error on parsing/handling content-disposition
SourceForge.net
noreply at sourceforge.net
Wed Aug 16 17:50:50 CEST 2006
Bugs item #1540529, was opened at 2006-08-15 06:31
Message generated for change (Comment added) made by jimjjewett
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1540529&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Dirk Holtwick (holtwick)
Assigned to: Nobody/Anonymous (nobody)
Summary: cgi.py error on parsing/handling content-disposition
Initial Comment:
A header like this one containing a ";" and blanks in
the content disposition fails:
Content-Disposition: form-data; name="_media";
filename="Demo; 28.07.2006.jpg"
The cause is, that the function parse_header() first
splits the line by ";" and then begins to analize these
parts. The part "filename" in our example is then split
into two separate parts.
I wrote a fix for the function parse_header(). It isn't
still complete, because escaped '"' on the end of line
are not respected, but in most cases it helps.
----------------------------------------------------------------------
Comment By: Jim Jewett (jimjjewett)
Date: 2006-08-16 11:50
Message:
Logged In: YES
user_id=764593
The test is good.
The corner case is misses would also be a good test.
I'm wondering whether a better fix might be to put parsing-
around-quotes in a common library, and import it from
there; these problems keep coming up, particularly in the
web-related modules.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1540529&group_id=5470
More information about the Python-bugs-list
mailing list