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 jaraco
Recipients barry, jaraco, r.david.murray
Date 2014-02-06.14:44:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391697894.48.0.687210900333.issue20531@psf.upfronthosting.co.za>
In-reply-to
Content
As reported in https://bitbucket.org/dholth/wheel/issue/104, the email.parser no longer accepts Unicode content as it did in 3.3. I searched the What's New and module documentation, but found no indication that this behavior is no longer supported, so it appears to be a regression. If it's an intentional change, the behavior should be documented in one of the aforementioned documents.

Consider this simple test case:

# -*- coding: utf-8 -*-
import email.parser
meta = """
Header: ☃
"""
email.parser.Parser().parsestr(meta)

Run that on Python 3.3.3 or Python 2 and it executes silently. Run it on Python 3.4.0b3 and it produces this traceback:

Traceback (most recent call last):
  File "C:\Users\jaraco\projects\public\wheel\test.py", line 6, in <module>
    email.parser.Parser().parsestr(meta)
  File "C:\Program Files\Python34\lib\email\parser.py", line 70, in parsestr
    return self.parse(StringIO(text), headersonly=headersonly)
  File "C:\Program Files\Python34\lib\email\parser.py", line 60, in parse
    return feedparser.close()
  File "C:\Program Files\Python34\lib\email\feedparser.py", line 170, in close
    self._call_parse()
  File "C:\Program Files\Python34\lib\email\feedparser.py", line 163, in _call_parse
    self._parse()
  File "C:\Program Files\Python34\lib\email\feedparser.py", line 449, in _parsegen
    self._cur.set_payload(EMPTYSTRING.join(lines))
  File "C:\Program Files\Python34\lib\email\message.py", line 311, in set_payload
    " payload") from None
TypeError: charset argument must be specified when non-ASCII characters are used in the payload
History
Date User Action Args
2014-02-06 14:44:54jaracosetrecipients: + jaraco, barry, r.david.murray
2014-02-06 14:44:54jaracosetmessageid: <1391697894.48.0.687210900333.issue20531@psf.upfronthosting.co.za>
2014-02-06 14:44:54jaracolinkissue20531 messages
2014-02-06 14:44:53jaracocreate