Commit 740527ab authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issues #23147, #23148: Presumably fixed bugs in folding UnstructuredTokenList.

parents 7905f99a 6c2f1fd7
...@@ -439,7 +439,7 @@ class UnstructuredTokenList(TokenList): ...@@ -439,7 +439,7 @@ class UnstructuredTokenList(TokenList):
if folded.append_if_fits(part): if folded.append_if_fits(part):
continue continue
if part.has_fws: if part.has_fws:
part.fold(folded) part._fold(folded)
continue continue
# It can't be split...we just have to put it on its own line. # It can't be split...we just have to put it on its own line.
folded.append(tstr) folded.append(tstr)
...@@ -460,7 +460,7 @@ class UnstructuredTokenList(TokenList): ...@@ -460,7 +460,7 @@ class UnstructuredTokenList(TokenList):
last_ew = len(res) last_ew = len(res)
else: else:
tl = get_unstructured(''.join(res[last_ew:] + [spart])) tl = get_unstructured(''.join(res[last_ew:] + [spart]))
res.append(tl.as_encoded_word()) res.append(tl.as_encoded_word(charset))
return ''.join(res) return ''.join(res)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment