Message140091
cgi.parse_header doesn't work on headers that contain combinations of double quotes and semicolons (although it works with either type of character individually).
>>> cgi.parse_header('form-data; name="files"; filename="fo\\"o;bar"')
('form-data', {'name': 'files', 'filename': '"fo\\"o'})
This issue is present in python 2.7 and 3.2. One solution is to change _parseparam as follows (same as email.message._parseparam):
def _parseparam(s):
while s[:1] == ';':
s = s[1:]
end = s.find(';')
while end > 0 and (s.count('"', 0, end) - s.count('\\"', 0, end)) % 2:
end = s.find(';', end + 1)
if end < 0:
end = len(s)
f = s[:end]
yield f.strip()
s = s[end:] |
|
Date |
User |
Action |
Args |
2011-07-10 20:56:05 | Ben.Darnell | set | recipients:
+ Ben.Darnell |
2011-07-10 20:56:05 | Ben.Darnell | set | messageid: <1310331365.35.0.0304262740475.issue12529@psf.upfronthosting.co.za> |
2011-07-10 20:56:04 | Ben.Darnell | link | issue12529 messages |
2011-07-10 20:56:03 | Ben.Darnell | create | |
|