This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sdaoden
Recipients sdaoden
Date 2011-04-06.13:49:43
SpamBayes Score 1.7801234e-07
Marked as misclassified No
Message-id <1302097785.46.0.28701143911.issue11782@psf.upfronthosting.co.za>
In-reply-to
Content
This snippet (for #11684, but it's simply BytesParser with
headersonly=True in the end)


        with openfile('msg_46.txt', 'rb') as fp:
            msgdata = fp.read()
        parser = email.parser.BytesHeaderParser()
        msg = parser.parsebytes(msgdata)
        out = BytesIO()
        gen = email.generator.BytesGenerator(out)
        gen.flatten(msg)
        self.assertEqual(out.getvalue(), msgdata)


causes this error:


ERROR: test_byte_message_rfc822_only (test_email.TestMessageAPI)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/steffen/usr/opt/py3k/lib/python3.3/test/test_email/test_email.py", line 200, in test_byte_message_rfc822_only
    gen.flatten(msg)
  File "/Users/steffen/usr/opt/py3k/lib/python3.3/email/generator.py", line 91, in flatten
    self._write(msg)
  File "/Users/steffen/usr/opt/py3k/lib/python3.3/email/generator.py", line 137, in _write
    self._dispatch(msg)
  File "/Users/steffen/usr/opt/py3k/lib/python3.3/email/generator.py", line 163, in _dispatch
    meth(msg)
  File "/Users/steffen/usr/opt/py3k/lib/python3.3/email/generator.py", line 304, in _handle_message
    self._fp.write(payload)
TypeError: 'str' does not support the buffer interface
History
Date User Action Args
2011-04-06 13:49:45sdaodensetrecipients: + sdaoden
2011-04-06 13:49:45sdaodensetmessageid: <1302097785.46.0.28701143911.issue11782@psf.upfronthosting.co.za>
2011-04-06 13:49:43sdaodenlinkissue11782 messages
2011-04-06 13:49:43sdaodencreate