New submission from Scott Kitterman <skl...@kitterman.com>: 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 <b...@kitterman.com>; Sun, 13 Mar 2011 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 <b...@kitterman.com>; Sun, 13 Mar 2011 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 <b...@kitterman.com>; Sun, 13 Mar 2011 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. ---------- components: None messages: 130793 nosy: kitterma priority: normal severity: normal status: open title: email.header.Header doesn't fold headers _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11492> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com