##// END OF EJS Templates
mail: ensure that Python2.4 to 2.7 use the same header format...
Nicolas Dumazet -
r11542:594b9884 stable
parent child Browse files
Show More
@@ -10,6 +10,26 b' import util, encoding'
10 10 import os, smtplib, socket, quopri
11 11 import email.Header, email.MIMEText, email.Utils
12 12
13 _oldheaderinit = email.Header.Header.__init__
14 def _unifiedheaderinit(self, *args, **kw):
15 """
16 Python2.7 introduces a backwards incompatible change
17 (Python issue1974, r70772) in email.Generator.Generator code:
18 pre-2.7 code passed "continuation_ws='\t'" to the Header
19 constructor, and 2.7 removed this parameter.
20
21 Default argument is continuation_ws=' ', which means that the
22 behaviour is different in <2.7 and 2.7
23
24 We consider the 2.7 behaviour to be preferable, but need
25 to have an unified behaviour for versions 2.4 to 2.7
26 """
27 # override continuation_ws
28 kw['continuation_ws'] = ' '
29 _oldheaderinit(self, *args, **kw)
30
31 email.Header.Header.__dict__['__init__'] = _unifiedheaderinit
32
13 33 def _smtp(ui):
14 34 '''build an smtp connection and return a function to send mail'''
15 35 local_hostname = ui.config('smtp', 'local_hostname')
@@ -573,7 +573,7 b' Displaying [PATCH 3 of 3] charset=utf-8;'
573 573 Content-Type: multipart/mixed; boundary="===
574 574 MIME-Version: 1.0
575 575 Subject: [PATCH 3 of 3] charset=utf-8;
576 content-transfer-encoding: quoted-printable
576 content-transfer-encoding: quoted-printable
577 577 X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
578 578 Message-Id: <c655633f8c87700bb38c.63@
579 579 In-Reply-To: <patchbomb.60@
@@ -836,7 +836,7 b' Displaying [PATCH 3 of 3] charset=utf-8;'
836 836 Content-Type: multipart/mixed; boundary="===
837 837 MIME-Version: 1.0
838 838 Subject: [PATCH 3 of 3] charset=utf-8;
839 content-transfer-encoding: quoted-printable
839 content-transfer-encoding: quoted-printable
840 840 X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
841 841 Message-Id: <c655633f8c87700bb38c.63@
842 842 In-Reply-To: <patchbomb.60@
@@ -1730,7 +1730,7 b' Content-Type: text/plain; charset="us-as'
1730 1730 MIME-Version: 1.0
1731 1731 Content-Transfer-Encoding: quoted-printable
1732 1732 Subject: [PATCH 3 of 8] charset=utf-8;
1733 content-transfer-encoding: quoted-printable
1733 content-transfer-encoding: quoted-printable
1734 1734 X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
1735 1735 Message-Id: <c655633f8c87700bb38c.315532863@
1736 1736 In-Reply-To: <patchbomb.315532860@
General Comments 0
You need to be logged in to leave comments. Login now