New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
email.header error during .flatten() #55610
Comments
Hello, David, the error from bpo-11116 occurred again, 21:34 ~/arena/code.extern.repos/py3k.hg $ hg identify Here is the dump: | Opening mbox mailbox /private/var/folders/Da/DaZX3-k5G8a57zw6MSmjJ++++TM/-Tmp-/mail/test
David: <class 'mailbox.mbox'> <-> <class 'mailbox.MaildirMessage'>
PANIC: [box] test: message-add failed.
Traceback (most recent call last):
File "/Users/steffen/usr/bin/s-postman.py", line 1093, in save_ticket
mb.add(ticket.message())
...
try:
print('David:', type(mb), ' <-> ', type(ticket.message()))
mb.add(ticket.message())
mb.flush()
except Exception as e:
efun('[box] ', self.id, ': message-add failed.\n', extb=E())
finally:
mb.unlock()
...
File "/Users/steffen/usr/opt/py3k/lib/python3.3/mailbox.py", line 595, in add
self._toc[self._next_key] = self._append_message(message)
File "/Users/steffen/usr/opt/py3k/lib/python3.3/mailbox.py", line 733, in _append_message
offsets = self._install_message(message)
File "/Users/steffen/usr/opt/py3k/lib/python3.3/mailbox.py", line 805, in _install_message
self._dump_message(message, self._file, self._mangle_from_)
File "/Users/steffen/usr/opt/py3k/lib/python3.3/mailbox.py", line 215, in _dump_message
gen.flatten(message)
File "/Users/steffen/usr/opt/py3k/lib/python3.3/email/generator.py", line 88, in flatten
self._write(msg)
File "/Users/steffen/usr/opt/py3k/lib/python3.3/email/generator.py", line 141, in _write
self._write_headers(msg)
File "/Users/steffen/usr/opt/py3k/lib/python3.3/email/generator.py", line 373, in _write_headers
self.write(header.encode(linesep=self._NL)+self._NL)
File "/Users/steffen/usr/opt/py3k/lib/python3.3/email/header.py", line 317, in encode
formatter.feed(lines[0], charset)
Exception: IndexError: list index out of range In the meanwhile the thing has dispatched tens of thousands |
David, i'm sending you data to reproduce the error on your local Please create a test directory and place the files therein mkdir -p issue_11401/input.mdir/{cur,new,tmp} (I'm looking forward for a glass of red wine, just in case we'll |
David, it seems my patch http://bugs.python.org/file20675/email_header.patch This is because BytesGenerator._write_headers() creates a Header I don't understand why i could pass thousands of mails, including |
I plan to take a look at this and other email bugs during the Pycon sprints, if not before. |
It turns out this is a bug in 3.1, not something introduced by email5.1 in 3.2. The minimum reproducer is stringifying any message containing a header with no body. |
On Tue, Mar 15, 2011 at 10:44:43PM +0000, R. David Murray wrote:
(Those are the *real* dangerous ones!) |
New changeset d9c3cfd36b58 by R David Murray in branch '3.1': New changeset 2de45ced8291 by R David Murray in branch '3.2': New changeset e318d84efe6e by R David Murray in branch 'default': |
OK, now this bit works like it did in Python2. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: