I have some code that uses the bundled email package to read an eml file. It works prior to v5, but now fails. Looks like a py3 incompatibility to me. I don't know where that package comes from, otherwise I'd look in more detail.
Code:
import six
import email
...
if f.endswith(".eml"):
fhandle = six.moves.urllib.request.urlopen(f)
msg = email.message_from_file(fhandle) # line 206
Error:
Code:
calibre, version 5.3.0
ERROR: Unhandled exception: <b>TypeError</b>:string argument expected, got 'bytes'
calibre 5.3* [64bit] embedded-python: True is64bit: True
Windows-10-10.0.19041-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', 'SP0', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: FanFicFare (3, 24, 10) && View Manager (1, 5, 7)
Traceback (most recent call last):
File "calibre_plugins.fanficfare_plugin.dialogs", line 206, in dropEvent
File "email\__init__.py", line 54, in message_from_file
File "email\parser.py", line 56, in parse
File "email\feedparser.py", line 175, in feed
File "email\feedparser.py", line 103, in push
TypeError: string argument expected, got 'bytes'