New submission from alter-bug-tracer <[email protected]>:
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'
----------
files: file0.zip
messages: 342940
nosy: alter-bug-tracer
priority: normal
severity: normal
status: open
title: email: AttributeError
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file48340/file0.zip
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue36976>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com