Last active
October 15, 2018 17:33
-
-
Save fumiyas/625e64e193fe17c3066efffcf8a75542 to your computer and use it in GitHub Desktop.
Mailman mm_cfg.py: Workaround for a bug of Python 2 email module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Workaround for the following bug of Python 2 email module: | |
## | |
## ```console | |
## $ ( | |
## echo 'from email.header import Header' | |
## echo 'print Header("X: =?ISO-2022-JP?Q?=1B$B%;%s=1B(B?=",maxlinelen=20)') | |
## ) |python2 | |
## X: =?ISO-2022-JP?Q?=1B$B%; | |
## %s=1B(B?= | |
## ``` | |
def email_generator_init_wrapper(self, *args, **kws): | |
email.generator.Generator.__init__orig(self, *args, **kws) | |
self._maxheaderlen = 0 | |
import email.generator | |
email.generator.Generator.__init__orig = email.generator.Generator.__init__ | |
email.generator.Generator.__init__ = email_generator_init_wrapper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment