Keep only the incomplete escape when quoted-printable data is split

Merged
KL
1mo ago
+14-5

QuotedPrintableDecoder.write() always held back the last two bytes when they contained =. If a write ended with a complete escape followed by a lone = (e.g. =41=), the escape got split and the next write decoded it as literal text:

d.write(b"=41=")
d.write(b"42")  # b"=41B", instead of b"AB"

Now it keeps everything from the first = within the last two bytes, so only an incomplete escape waits for the next write. Using the first = (not the last) keeps == decoding to =.

Supersedes #344.

AI Disclaimer

This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.