Problemas archlinux encoding

gafecito

Usuario Novato
2 Ene 2022
1
0
1
49
Lo primero: saludaros y daros las gracias por el curro.

Desde que en arch actualizaron a python 3.10 tuve un par de problemillas, y tuve que hacer un downgrade (en la misma 3.10) por este bug:

Desde ese momento me dejó de funcionar entrepeliculasyseries con este error:
ERROR <general>: [alfa.platformcode.launcher.run] Traceback (most recent call last): File "/home/xxx/.kodi/addons/plugin.video.alfa/platformcode/launcher.py", line 325, in run itemlist = getattr(channel, item.action)(item) File "/home/xxx/.kodi/addons/plugin.video.alfa/channels/entrepeliculasyseries.py", line 97, in list_all soup = create_soup(item.url) File "/home/xxx/.kodi/addons/plugin.video.alfa/channels/entrepeliculasyseries.py", line 86, in create_soup soup = BeautifulSoup(data, "lxml", from_encoding="utf-8") File "/home/xxx/.kodi/addons/script.module.beautifulsoup4/lib/bs4/__init__.py", line 243, in __init__ raise FeatureNotFound( bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html5lib. Do you need to install a parser library?

lo que me llevó a esta línea de entrepeliculasyseries.py :

soup = BeautifulSoup(data, "html5lib", from_encoding="utf-8")

Como no controlo mucho de python, probe con lxml pero como más arriba en el log había un error sobre el encoding:

2022-01-02 09:17:22.583 T:3366 ERROR <general>: ######## ERROR ######### 2022-01-02 09:17:22.583 T:3366 ERROR <general>: [alfa.core.httptools.downloadpage] Traceback (most recent call last): File "/home/xxx/.kodi/addons/plugin.video.alfa/core/httptools.py", line 746, in downloadpage response['data'] = response['data'].decode(encoding) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 31110: invalid continuation byte 2022-01-02 09:17:22.596 T:3366 ERROR <general>: /home/xxx/.kodi/addons/script.module.beautifulsoup4/lib/bs4/__init__.py:221: UserWarning: You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored. warnings.warn("You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.")

probé así:

soup = BeautifulSoup(data)

...y me ha vuelto a funcionar correctamente. Por si os sirve de algo.