[3.8] bpo-36564: Fix infinite loop in email folding logic (GH-12732) by miss-islington · Pull Request #14797 · python/cpython

@pganssle @miss-islington

As far as I can tell, this infinite loop would be triggered if:

1. The value being folded contains a single word (no spaces) longer than
   max_line_length
2. The max_line_length is shorter than the encoding's name + 9
   characters.

bpo-36564: https://bugs.python.org/issue36564
(cherry picked from commit f69d5c6)

Co-authored-by: Paul Ganssle <pganssle@users.noreply.github.com>

@warsaw warsaw changed the title [3.8] Fix infinite loop in email folding logic (GH-12732) [3.8] bpo-36564: Fix infinite loop in email folding logic (GH-12732)

Jul 16, 2019