View Single Post
Old 08-11-2024, 07:38 AM   #3071
damccull
Junior Member
damccull began at the beginning.
 
Posts: 2
Karma: 32
Join Date: Aug 2024
Device: Kobo Libra 2
Thanks, @WovenTales, for identifying the issue with deprecated stuff in python 3.12. I made a very small patch, following what the python changelog says, and it works great on my calibre. Here's my patched version if anyone's interested. All I did was change SafeConfigParser to ConfigParser in 4 locations. I also bumped the version to 2.17.2 and added a change to the changelog, and added a quick note to the about.txt message for a new source code location. Seems to work great on my machine.

Does anyone know how to get in touch with the cbhaley person who seems to be maintaining this plugin's release? New to the forum and unsure how to do that.

Quote:
Originally Posted by WovenTales View Post
I'm getting the same, but I don't think that's the fault of the Linux packaging, at least on my system:

Code:
Traceback (most recent call last):
  File "/usr/lib64/calibre/calibre/gui2/ui.py", line 147, in __init__
    ac = self.init_iaction(action)
         ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/calibre/calibre/gui2/ui.py", line 165, in init_iaction
    ac = action.load_actual_plugin(self)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/calibre/calibre/customize/__init__.py", line 659, in load_actual_plugin
    ac = getattr(importlib.import_module(mod), cls)(gui,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "/usr/lib64/calibre/calibre/customize/zipplugin.py", line 205, in exec_module
    exec(compiled, module.__dict__)
  File "calibre_plugins.koboutilities.action", line 40, in <module>
    from six.moves.configparser import SafeConfigParser
ImportError: cannot import name 'SafeConfigParser' from 'configparser' (/usr/lib/python3.12/configparser.py). Did you mean: 'RawConfigParser'?
...and from the Python 3.12 release notes:



I've not looked into what it would take to patch/hack the plugin in order to verify that updating that typing fixes things, but even if it's not the specific problem we're running into (and this would be a particularly bad message to expose it if it is), it is at the very least a bug in the plugin.

(Also, don't know about the quality of the packaging on other distros, but I'm on Gentoo where everything is built from source and where "download the binary from the website" is not an acceptable solution.)
Attached Files
File Type: zip KoboUtilities-1.7.2.zip (326.4 KB, 1057 views)
damccull is offline