[issue11492] email.header.Header doesn't fold headers correctly

2018-11-07 Thread STINNER Victor
STINNER Victor added the comment: I wrote PR 10378 to show that I don't think that this bug must be fixed in Python 2: it would break any application relying on the current folding algorithm. -- nosy: +vstinner ___ Python tracker

[issue11492] email.header.Header doesn't fold headers correctly

2018-11-07 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +9680 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11492] email.header.Header doesn't fold headers correctly

2012-01-02 Thread Srikanth S
Changes by Srikanth S sriks...@gmail.com: -- nosy: +srikanths ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11492 ___ ___ Python-bugs-list mailing

[issue11492] email.header.Header doesn't fold headers correctly

2011-04-18 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 51a551acb60d by R David Murray in branch '3.2': #11492: rewrite header folding algorithm. Less code, more passing tests. http://hg.python.org/cpython/rev/51a551acb60d New changeset fcd20a565b95 by R David Murray in branch

[issue11492] email.header.Header doesn't fold headers correctly

2011-04-18 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11492

[issue11492] email.header.Header doesn't fold headers correctly

2011-04-10 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: This was quite the adventure. The more I worked on fixing the tests, the more if/else cases the existing splitting algorithm grew. When I reached the point where fixing one test broke two others, I thought maybe it was time to try a

[issue11492] email.header.Header doesn't fold headers correctly

2011-04-10 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Note that this fix solves issue 11772, so I've closed that one as a duplicate. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11492

[issue11492] email.header.Header doesn't fold headers at spaces if value contains '; 's

2011-04-07 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: OK, it looks like the wrapping problem arises when the line contains runs of blank delimited tokens longer than maxlinelen *and* the line also contains ';'s. The line is then split at the ';' and the remaining overlong pieces are not

[issue11492] email.header.Header doesn't fold headers correctly

2011-04-07 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Here is a patch containing three test cases that demonstrate three different failings of the header folding algorithm. I'm working on the fix, but it is non-trivial. -- components: +Library (Lib) -None keywords: +patch title:

[issue11492] email.header.Header doesn't fold headers correctly

2011-04-07 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: Removed file: http://bugs.python.org/file21563/header_folding_tests.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11492 ___

[issue11492] email.header.Header doesn't fold headers correctly

2011-04-07 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Note that 2.7 fails two of these tests as well, but for different reasons. I'm not currently planning to fix 2.7, as its behavior at least (a) doesn't lose non-whitespace information and (b) doesn't exceed the maxheaderlen. --

[issue11492] email.header.Header doesn't fold headers correctly

2011-04-07 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: Removed file: http://bugs.python.org/file21564/header_folding_tests.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11492 ___

[issue11492] email.header.Header doesn't fold headers correctly

2011-04-07 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Here is an updated test patch that brings the test coverage of the relevant code much closer to 100%. There are still three lines and one branch uncovered, but it appears as though one of the bugs is preventing the test case that would

[issue11492] email.header.Header doesn't fold headers correctly

2011-04-07 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 10725fc76e11 by R David Murray in branch '3.1': #11492: fix header truncation on folding when there are runs of split chars. http://hg.python.org/cpython/rev/10725fc76e11 New changeset 74ec64dc3538 by R David Murray in branch '3.2':

[issue11492] email.header.Header doesn't fold headers

2011-04-06 Thread Scott Kitterman
Scott Kitterman skl...@kitterman.com added the comment: Not so fast ... I may have done this wrong, but I get: print(Header(hdrin,maxlinelen=78)) Received: from mailout00.controlledmail.com (mailout00.controlledmail.com [72.81.252.19]) by mailwash7.pair.com (Postfix) with ESMTP id 16BB5BAD5

[issue11492] email.header.Header doesn't fold headers at spaces

2011-04-06 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: You have to do an 'encode' to get the wrapped header. __str__ uses maxlinelen=None. However, there does seem to be a problem with the line wrapping algorithm revealed by your example: it is only doing a line break at the ';', not at any

[issue11492] email.header.Header doesn't fold headers

2011-04-05 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Ah, it isn't broken, it's just that the default changed. In 2.x, the default was maxlinelen=78, in 3.x, the default is maxlinelen=None (unlimited), but generator passes in an override of 78 when formatting output. So you can specify

[issue11492] email.header.Header doesn't fold headers

2011-03-14 Thread Scott Kitterman
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

[issue11492] email.header.Header doesn't fold headers

2011-03-14 Thread Barry A. Warsaw
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry, r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11492 ___ ___

[issue11492] email.header.Header doesn't fold headers

2011-03-14 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: It exists, but clearly it is broken. I'll look in to it. -- assignee: - r.david.murray stage: - needs patch type: - behavior versions: +Python 3.1, Python 3.2, Python 3.3 ___ Python tracker