Closed stobb3s closed 3 years ago
@stobb3s Thanks for this detailed analysis. Actually I found that I've forgot to push the latest version to the repo. I refactored the code , switched to the new settings format and wanted to test it.
Nevertheless, I have changed the code (now in opml_file.py'
) But I haven't seen the exception in my setup (also v2.1.0)
Maybe you want to try the latest version , i.e. `plugin.audio.podcasts.2.2.1-pre.zip
I'm going to install it in my Kodi setup and test it for a while before pushing it to the repo.
My Kodi version is 19.2 running on Ubuntu 21.04 (x64)
I inspected the issue a bit further. I changed the code to print the default locale encoding to the log
import locale
...
...
xbmc.log(f"Prefered Encoding: {locale.getpreferredencoding()}",xbmc.LOGINFO)
Here is the result on Kodi 19.1:
2021-10-17 11:19:12.797 T:121165 INFO <general>: Prefered Encoding: UTF-8
And here is the result on Kodi 19.2:
2021-10-17 11:12:21.824 T:120312 INFO <general>: Prefered Encoding: ANSI_X3.4-1968
Since this is based on locale, that explains why you aren't seeing it. I guess since I have a US locale, Python is now assuming that I want ASCII encoding. Oddly, when I use the Python interpreter provided by my distro, it still shows UTF-8. Not sure why Kodi thinks different. I think I am going to report this to the Kodi devs because most likely many other addons are affected. I will try your updated version and let you know the results. Thanks.
Just tested the updated release and the OPML file reads correctly now. Thanks.
I'm still using the plugin version 2.1.0, which is the latest version in the official repo. When I upgraded Kodi to 19.2, I noticed that my OPML files that were exported from gPodder will no longer open in the plugin. In the log, the error message on my Linux PC is:
I also tried it on Windows, and the behavior was the same. I traced the issue to the try/expect block that starts on line 381. I removed the try/except to see the error in the log, this was the result:
From the error message, it appears that this is a file decoding issue. My OPML file is encoded in UTF-8, but Python is assuming that it is ASCII encoding, then fails when a non-ASCII character is detected. No file encoding is specified for the file
open()
on line 365. When I specify UTF-8 encoding to Python, the file opens correctly:Something must have changed in Python for when no encoding is specified between 19.1 and 19.2. The default encoding may also be based on the locale of the user, so it may not be easy to reproduce. I think it is a good idea to specify UTF-8 as a standard encoding. If that fails, then maybe try other encodings. But UTF-8 is a de facto standard for web content these days.
If you need more info or can't reproduce, then I can upload an .opml file. Thanks.