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 alter-bug-tracer
Recipients alter-bug-tracer
Date 2019-05-20.18:19:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558376398.04.0.740342940317.issue36976@roundup.psfhosted.org>
In-reply-to
Content
The 'lower' method is called on a Header object when trying to parse the attached file.

Code:
import email
import sys
with open(sys.argv[1], "rb") as f:
  msg = email.message_from_binary_file(f)
  print (len(msg))


Traceback:
    msg = email.message_from_binary_file(f)
  File "/usr/lib/python3.5/email/__init__.py", line 62, in message_from_binary_file
    return BytesParser(*args, **kws).parse(fp)
  File "/usr/lib/python3.5/email/parser.py", line 110, in parse
    return self.parser.parse(fp, headersonly)
  File "/usr/lib/python3.5/email/parser.py", line 57, in parse
    feedparser.feed(data)
  File "/usr/lib/python3.5/email/feedparser.py", line 178, in feed
    self._call_parse()
  File "/usr/lib/python3.5/email/feedparser.py", line 182, in _call_parse
    self._parse()
  File "/usr/lib/python3.5/email/feedparser.py", line 322, in _parsegen
    if (self._cur.get('content-transfer-encoding', '8bit').lower()
AttributeError: 'Header' object has no attribute 'lower'
History
Date User Action Args
2019-05-20 18:19:58alter-bug-tracersetrecipients: + alter-bug-tracer
2019-05-20 18:19:58alter-bug-tracersetmessageid: <1558376398.04.0.740342940317.issue36976@roundup.psfhosted.org>
2019-05-20 18:19:57alter-bug-tracerlinkissue36976 messages
2019-05-20 18:19:57alter-bug-tracercreate