[issue16811] email.message.Message flatten dies of list index out of range

2015-11-20 Thread R. David Murray

R. David Murray added the comment:

Please open a new issue and provide a reproducer.  Thanks.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16811] email.message.Message flatten dies of list index out of range

2015-11-20 Thread Jan Malte

Jan Malte added the comment:

seems like this happens still, if the CC header starts with a new line 
character.

Python 3.4.3

--
nosy: +janmalte

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16811] email.message.Message flatten dies of list index out of range

2013-02-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4553dfcafac7 by R David Murray in branch '3.3':
News item for issue #16811 fix.
http://hg.python.org/cpython/rev/4553dfcafac7

New changeset 68be406e76e1 by R David Murray in branch 'default':
Merge: News item for issue #16811 fix.
http://hg.python.org/cpython/rev/68be406e76e1

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16811] email.message.Message flatten dies of list index out of range

2013-02-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e64b74227198 by R David Murray in branch '3.3':
#16811: Fix folding of headers with no value in provisional policies.
http://hg.python.org/cpython/rev/e64b74227198

New changeset fe7f3e2e49ce by R David Murray in branch 'default':
Merge #16811: Fix folding of headers with no value in provisional policies.
http://hg.python.org/cpython/rev/fe7f3e2e49ce

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16811] email.message.Message flatten dies of list index out of range

2013-02-04 Thread R. David Murray

R. David Murray added the comment:

Fixed, thanks.  There are some other issues with folding values consisting of 
only blanks, but I'll deal with that in the context of other issues.  With this 
fix the new folding algorithm works at least as well as the old folding 
algorithm on blank values.

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16811] email.message.Message flatten dies of list index out of range

2012-12-29 Thread Helmut Jarausch

New submission from Helmut Jarausch:

The following code triggers the bug:

#!/usr/bin/python3.3
#-*- coding: latin1 -*-
from email.message import Message
from email import policy
from email.parser import FeedParser

Parser= FeedParser(policy=policy.SMTP)
Parser.feed('From jarau...@igpm.rwth-aachen.de  Tue Apr 24 15:09:24 2012\n')
Parser.feed('X-Status:\n')  # this triggers the bug
Parser.feed('From: Helmut Jarausch jarau...@igpm.rwth-aachen.de\n')

Msg= Parser.close()
Msg_as_str= Msg.as_string(unixfrom=True)

This triggers
  File Email_Parse_Bug.py, line 13, in module
Msg_as_str= Msg.as_string(unixfrom=True)
  File /usr/lib64/python3.3/email/message.py, line 151, in as_string
g.flatten(self, unixfrom=unixfrom)
  File /usr/lib64/python3.3/email/generator.py, line 112, in flatten
self._write(msg)
  File /usr/lib64/python3.3/email/generator.py, line 171, in _write
self._write_headers(msg)
  File /usr/lib64/python3.3/email/generator.py, line 198, in _write_headers
self.write(self.policy.fold(h, v))
  File /usr/lib64/python3.3/email/policy.py, line 153, in fold
return self._fold(name, value, refold_binary=True)
  File /usr/lib64/python3.3/email/policy.py, line 176, in _fold
(len(lines[0])+len(name)+2  maxlen or
IndexError: list index out of range


If I strip the '\n' from the lines feeded to the Parser,
the bug does not occur.

Thanks for looking into it,
Helmut.

This is with  Python 3.3.0+ 3.3:ccc372b37fbb+

--
components: Library (Lib)
messages: 178482
nosy: HJarausch
priority: normal
severity: normal
status: open
title: email.message.Message flatten dies of list index out of range
type: crash
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16811] email.message.Message flatten dies of list index out of range

2012-12-29 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
components: +email
nosy: +barry, r.david.murray
stage:  - needs patch
type: crash - behavior
versions: +Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16811] email.message.Message flatten dies of list index out of range

2012-12-29 Thread R. David Murray

R. David Murray added the comment:

Thanks for the report.

We thought we fixed this once already (in issue 11401).  It looks like that 
only fixed the old folding algorithm, and that the new one has the same bug.  
I thought the test ran against both algorithms, but I must have made a mistake.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com