]> granicus.if.org Git - python/commitdiff
Issues #23147, #23148: Presumably fixed bugs in folding UnstructuredTokenList.
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 17 Jul 2016 10:25:15 +0000 (13:25 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 17 Jul 2016 10:25:15 +0000 (13:25 +0300)
Lib/email/_header_value_parser.py

index 2226e137e1a1c0e9594edb46ccd60e956bc6d841..5df9511e8d90647e9fae9caa40652b0fc340dd02 100644 (file)
@@ -439,7 +439,7 @@ class UnstructuredTokenList(TokenList):
                 if folded.append_if_fits(part):
                     continue
             if part.has_fws:
-                part.fold(folded)
+                part._fold(folded)
                 continue
             # It can't be split...we just have to put it on its own line.
             folded.append(tstr)
@@ -460,7 +460,7 @@ class UnstructuredTokenList(TokenList):
                     last_ew = len(res)
                 else:
                     tl = get_unstructured(''.join(res[last_ew:] + [spart]))
-                    res.append(tl.as_encoded_word())
+                    res.append(tl.as_encoded_word(charset))
         return ''.join(res)