Message283702
Hi all,
I hate this proposition. I feel it's a "victory" for the people who don't want to follow RFC standard and allow "triple"-quoting on things that aren't supposed to...
Now that my opinion is said, I made 2 test case that should be added to the test_email file of the test library to support the change :
_________________________________________________________
def test_rfc2231_multiple_quote_boundary(self):
m = '''\
Content-Type: multipart/alternative;
\tboundary*0*="<<This%20is%20even%20more%20";
\tboundary*1*="%2A%2A%2Afun%2A%2A%2A%20";
\tboundary*2="is it not.pdf>>"
'''
msg = email.message_from_string(m)
self.assertEqual(msg.get_boundary(),
'<<This is even more ***fun*** is it not.pdf>>')
def test_rfc2231_multiple_quote_boundary2(self):
m = '''\
Content-Type: multipart/alternative;
\tboundary="<<This is even more >>";
'''
msg = email.message_from_string(m)
self.assertEqual(msg.get_boundary(),
'<<This is even more >>')
_______________________________________________________
The problem however does lie within collapse function as you've mentionned (because you've taken the code from there haven't you? :P) :
def collapse_rfc2231_value(value, errors='replace',
fallback_charset='us-ascii'):
if not isinstance(value, tuple) or len(value) != 3:
return value <=======removed unquote on value
This doesn't seem to have broken any of the 1580 tests case of test_email (Python3.7), but I can't help but to feel weird about it. Could someone explain why we were unquoting there? and why use those weird condition (not isintance(value,tuple) or len(value) !=3)....?
Regards,
Eric Lafontaine |
|
Date |
User |
Action |
Args |
2016-12-20 16:21:22 | Eric Lafontaine | set | recipients:
+ Eric Lafontaine, barry, r.david.murray, bpoaugust |
2016-12-20 16:21:22 | Eric Lafontaine | set | messageid: <1482250882.6.0.258486817509.issue28945@psf.upfronthosting.co.za> |
2016-12-20 16:21:22 | Eric Lafontaine | link | issue28945 messages |
2016-12-20 16:21:22 | Eric Lafontaine | create | |
|