1.1 --- a/GPGUtils.py Sat Apr 11 17:07:59 2015 +0200
1.2 +++ b/GPGUtils.py Sun Apr 12 19:35:41 2015 +0200
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 GPG utilities derived from the MoinMessage library.
1.6
1.7 -Copyright (C) 2012, 2013, 2014 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2012, 2013, 2014, 2015 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -19,8 +19,12 @@
1.13 this program. If not, see <http://www.gnu.org/licenses/>.
1.14 """
1.15
1.16 +# NOTE: Nasty fix-up for the email module, thanks to the Python 2 abandonment
1.17 +# NOTE: policy of the core developers.
1.18 +
1.19 +from emailfix.generator import Generator
1.20 +
1.21 from email.encoders import encode_noop
1.22 -from email.generator import Generator
1.23 from email.mime.multipart import MIMEMultipart
1.24 from email.mime.application import MIMEApplication
1.25 from email.mime.base import MIMEBase
1.26 @@ -347,7 +351,7 @@
1.27
1.28 out = StringIO()
1.29 generator = Generator(out, False, 0) # disable reformatting measures
1.30 - generator.flatten(message)
1.31 + generator.flatten(message, linesep="\r\n")
1.32 return out.getvalue()
1.33
1.34 # Message decoding functions.