Fix an e-mail regression on Python 3 due to an old Python 2.6 fix.

Review Request #11671 — Created June 23, 2021 and submitted — Latest diff uploaded

Information

Review Board
release-4.0.x

Reviewers

Back in Python 2.6 timeframe, e-mail multi-line headers used a
continuation character of \t for subsequent lines, which was
problematic on some e-mail clients. Python 2.7 changed this to a space
character (https://bugs.python.org/issue1974).

Since this impacted our users
(https://hellosplat.com/s/beanbag/tickets/3613/), we monkey-patched the
continuation character for Python 2.6 installs.

Unfortunately, this later broke Python 3, as the character was a byte
string, and Python 3 expected to be dealing with Unicode strings. It
wasn't really a problem unless the subsequent lines contained Unicode
characters, which would trip a particular code path in the
email.header.

We no longer support Python 2.6, and have no reason to maintain this
fix, as our injected character has been the default for a long time.
This removes that code entirely, fixing this issue and delegating purely
to Python e-mail code.

Generated some e-mails with long headers that contained Unicode, and
verified the issue along with the fix.

Unit tests were not added, as they'd just be testing the default
behavior/absense of our monkey-patched code, and aren't particularly
useful for any future regression testing (since we're not in charge
of Python's email module).

Commits

Files

    Loading...