BeautifulSoup4 not Python3 compatible?
#1
Taken the first stumbling steps towards moving my addons to Python3.

As I understand, most module addons are supposed to be 2/3 compatible already? Is that correct?

I have run into an issue with BeautifulSoup4, i.e.
Code:
from bs4 import BeautifulSoup

Code:

2019-09-06 11:08:03.916 T:18446744073709551614   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <class 'ModuleNotFoundError'>
                                            Error Contents: No module named 'htmlentitydefs'
                                            Traceback (most recent call last):
                                              File "C:\Kodi\Leia-Python3\portable_data\addons\weather.ozweather\default.py", line 35, in <module>
                                                from weatherzone import *
                                              File "C:\Kodi\Leia-Python3\portable_data\addons\weather.ozweather\resources\lib\weatherzone.py", line 20, in <module>
                                                from bs4 import BeautifulSoup
                                              File "C:\Kodi\Leia-Python3\portable_data\addons\script.module.beautifulsoup4\lib\bs4\__init__.py", line 36, in <module>
                                                from .builder import builder_registry, ParserRejectedMarkup
                                              File "C:\Kodi\Leia-Python3\portable_data\addons\script.module.beautifulsoup4\lib\bs4\builder\__init__.py", line 7, in <module>
                                                from bs4.element import (
                                              File "C:\Kodi\Leia-Python3\portable_data\addons\script.module.beautifulsoup4\lib\bs4\element.py", line 13, in <module>
                                                from bs4.dammit import EntitySubstitution
                                              File "C:\Kodi\Leia-Python3\portable_data\addons\script.module.beautifulsoup4\lib\bs4\dammit.py", line 14, in <module>
                                                from htmlentitydefs import codepoint2name
                                            ModuleNotFoundError: No module named 'htmlentitydefs'
                                            -->End of Python script error report<--

Is the sort of thing where we just have to wait for a fix?  Is there a proper place to report these sorts of issues as we run in to them?
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#2
I investigated this error and found out that the Kodi Python 3 test build is using the BeautifulSoup4 Python 2 version. That's obviously a bug.
For now you have to manually download http://mirrors.kodi.tv/addons/migration/...-4.6.3.zip and install this package in Kodi with "Install from zip file"
I reported this problem at https://github.com/xbmc/xbmc/issues/16577
Reply
#3
Thanks for your response - that is helpful.  I'll get back on to this soon and try that out...it's the major dependency for my main addon, so definitely needed!
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#4
Python 3 support is now part of the nightly builds, but the same error still happens: https://github.com/xbmc/xbmc/pull/16116#...-542301959
Reply
#5
BeautifulSoup 4.6.3 is now available in the matrix addon repo.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#6
Thanks, this fixes this issue for good.
Reply

Logout Mark Read Team Forum Stats Members Help
BeautifulSoup4 not Python3 compatible?0