Issue5277
Created on 2009-02-16 04:35 by msapiro, last changed 2022-04-11 14:56 by admin. This issue is now closed.
| Files |
|
|
|
| File name |
Uploaded |
Description |
Edit |
| message.patch |
msapiro,2009-02-16 04:35 |
Patch to not count quoted quotes in _parseparams() |
|
| issue5277.patch |
rcoyner,2010-03-04 07:21 |
email.get_param() properly escapes quotations. |
|
| Messages (4) |
|
|
| msg82215 - (view) |
Author: Mark Sapiro (msapiro) *  |
Date: 2009-02-16 04:35 |
| The message method get_params() and the related get_param() and get_filename() do not properly decode an RFC 2231 encoded parameter such as the following: Content-Disposition: inline; filename*0="Re: [Mailman-Users] Messages shunted with \"TypeError: "; filename*1="decodingUnicode is not supported\".eml" This is because the message helper function _parseparams() mistakenly thinks the second semicolon is inside a quoted string because it counts the quoted (escaped) quote and sees an odd number. The attached patch will fix this. |
|
|
| msg100377 - (view) |
Author: Ryan Coyner (rcoyner) |
Date: 2010-03-04 07:21 |
| Okay, bug confirmed: >>> m = email.message_from_string('Content-Disposition: inline; filename*0="foo \\"test"; filename*1="\\"bar"') >>> m.get_filename() 'foo "test"; filename*1=""bar' And here is the result with the patch applied: >>> m = email.message_from_string('Content-Disposition: inline; filename*0="foo \\"test"; filename*1="\\"bar"') >>> m.get_filename() 'foo "test"bar' Attached a patch. Unit test included. |
|
|
| msg102976 - (view) |
Author: Shashwat Anand (l0nwlf) |
Date: 2010-04-12 21:48 |
| According to RFC2231 the named disposition (content disposition field) is provided by the MIME mechanism. The encoded parameter like the following: Content-Disposition: inline; filename*0="Re: [Mailman-Users] Messages shunted with \"TypeError: "; filename*1="decodingUnicode is not supported\".eml" is not behaving the way it should be. The patch by rcoyner seems fine to me as it rectifies the wrong behaviour of _parseparam i.e. the counting issue of nested 'double quotes' and clears the unit tests. |
|
|
| msg103140 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2010-04-14 19:08 |
| Thanks Mark and Ryan for the patches, and Shashwat for the review. Committed to trunk in r80062, 2.6 in r80063, py3k in r80078, and 3.1 in r80079. |
|
|
| History |
|
|
|
| Date |
User |
Action |
Args |
| 2022-04-11 14:56:45 |
admin |
set |
github: 49527 |
| 2010-04-14 19:08:09 |
r.david.murray |
set |
status: open -> closedresolution: fixedmessages: + stage: patch review -> resolved |
| 2010-04-12 21:48:44 |
l0nwlf |
set |
nosy: + l0nwlfmessages: + |
| 2010-03-04 12:35:52 |
r.david.murray |
set |
assignee: r.david.murraynosy: + r.david.murraystage: test needed -> patch review |
| 2010-03-04 07:21:45 |
rcoyner |
set |
files: + issue5277.patchnosy: + rcoynermessages: + |
| 2010-01-08 01:49:06 |
r.david.murray |
set |
priority: normalkeywords: + easystage: test neededversions: + Python 2.7, Python 3.2, - Python 2.5, Python 2.4, Python 3.0 |
| 2009-02-16 04:35:14 |
msapiro |
create |
|