Message130793
| Author |
kitterma |
| Recipients |
kitterma |
| Date |
2011年03月14日.07:32:57 |
| SpamBayes Score |
6.6254215e-05 |
| Marked as misclassified |
No |
| Message-id |
<1300087978.39.0.703069545984.issue11492@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Header folding is very different (non-existent as far as I've found so far) in Python3. Here's a short example:
#!/usr/bin/python
# -*- coding: ISO-8859-1
from email.header import Header
hdrin = 'Received: from mailout00.controlledmail.com (mailout00.controlledmail.com [72.81.252.19]) by mailwash7.pair.com (Postfix) with ESMTP id 16BB5BAD5 for <bcc@kitterman.com>; 2011年3月13日 23:46:05 -0400 (EDT)'
print(Header(hdrin))
With python2.6 the output is:
Received: from mailout00.controlledmail.com (mailout00.controlledmail.com
[72.81.252.19]) by mailwash7.pair.com (Postfix) with ESMTP id 16BB5BAD5 for
<bcc@kitterman.com>; 2011年3月13日 23:46:05 -0400 (EDT)
With python3.1 or 3.2 the output is one line:
Received: from mailout00.controlledmail.com (mailout00.controlledmail.com [72.81.252.19]) by mailwash7.pair.com (Postfix) with ESMTP id 16BB5BAD5 for <bcc@kitterman.com>; 2011年3月13日 23:46:05 -0400 (EDT)
This makes it very difficult to write header processing code that works for both Python2 and Python3 even if one can fold headers at all in Python3. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年03月14日 07:32:58 | kitterma | set | recipients:
+ kitterma |
| 2011年03月14日 07:32:58 | kitterma | set | messageid: <1300087978.39.0.703069545984.issue11492@psf.upfronthosting.co.za> |
| 2011年03月14日 07:32:57 | kitterma | link | issue11492 messages |
| 2011年03月14日 07:32:57 | kitterma | create |
|