Show More
@@ -24,26 +24,6 b' from . import (' | |||||
24 | util, |
|
24 | util, | |
25 | ) |
|
25 | ) | |
26 |
|
26 | |||
27 | _oldheaderinit = email.header.Header.__init__ |
|
|||
28 | def _unifiedheaderinit(self, *args, **kw): |
|
|||
29 | """ |
|
|||
30 | Python 2.7 introduces a backwards incompatible change |
|
|||
31 | (Python issue1974, r70772) in email.Generator.Generator code: |
|
|||
32 | pre-2.7 code passed "continuation_ws='\t'" to the Header |
|
|||
33 | constructor, and 2.7 removed this parameter. |
|
|||
34 |
|
||||
35 | Default argument is continuation_ws=' ', which means that the |
|
|||
36 | behavior is different in <2.7 and 2.7 |
|
|||
37 |
|
||||
38 | We consider the 2.7 behavior to be preferable, but need |
|
|||
39 | to have an unified behavior for versions 2.4 to 2.7 |
|
|||
40 | """ |
|
|||
41 | # override continuation_ws |
|
|||
42 | kw['continuation_ws'] = ' ' |
|
|||
43 | _oldheaderinit(self, *args, **kw) |
|
|||
44 |
|
||||
45 | setattr(email.header.Header, '__init__', _unifiedheaderinit) |
|
|||
46 |
|
||||
47 | class STARTTLS(smtplib.SMTP): |
|
27 | class STARTTLS(smtplib.SMTP): | |
48 | '''Derived class to verify the peer certificate for STARTTLS. |
|
28 | '''Derived class to verify the peer certificate for STARTTLS. | |
49 |
|
29 |
General Comments 0
You need to be logged in to leave comments.
Login now