This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Eric Lafontaine
Recipients Eric Lafontaine, barry, bpoaugust, r.david.murray
Date 2016-12-20.16:21:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1482250882.6.0.258486817509.issue28945@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2016-12-20 16:21:22Eric Lafontainesetrecipients: + Eric Lafontaine, barry, r.david.murray, bpoaugust
2016-12-20 16:21:22Eric Lafontainesetmessageid: <1482250882.6.0.258486817509.issue28945@psf.upfronthosting.co.za>
2016-12-20 16:21:22Eric Lafontainelinkissue28945 messages
2016-12-20 16:21:22Eric Lafontainecreate