So, while testing, this happened:
log:
EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'TypeError'>
Error Contents: parse() got an unexpected keyword argument 'transport_encoding'
Traceback (most recent call last):
File "…\script.module.mechanize\lib\mechanize\_html.py", line 189, in content_parser
from html5_parser import parse
ModuleNotFoundError: No module named 'html5_parser'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "…\plugin.video.amazon-test\resources\lib\network.py", line 460, in LogIn
if 'signIn' not in [i.name for i in br.forms()]:
File "…\script.module.mechanize\lib\mechanize\_mechanize.py", line 526, in forms
return self._factory.forms()
File "…\script.module.mechanize\lib\mechanize\_html.py", line 320, in forms
self._current_forms, self._current_global_form = self._get_forms()
File "…\script.module.mechanize\lib\mechanize\_html.py", line 335, in _get_forms
if self.root is None:
File "…\script.module.mechanize\lib\mechanize\_html.py", line 300, in root
transport_encoding=transport_encoding)
File "…\script.module.mechanize\lib\mechanize\_html.py", line 195, in content_parser
return parse(data, **kw)
TypeError: parse() got an unexpected keyword argument 'transport_encoding'
-->End of Python script error report<--
From what I read, Mechanize needs a specific version of html5lib which is not available from the repo (0.999.0 won't work), and (take it with a bit of salt as I haven't confirmed this) installing that specific version breaks (or used to break) BeautifulSoup. In order for mechanize to work it might be needed to embed that specific version of html5lib into it, instead of using the one from the repos. I didn't test this yet as my "partner in crime" already completed the migration to MechanicalSoup, but I'm dropping these info here in case someone needs them.