View Single Post
Old 10-20-2025, 07:30 PM   #27
ARR8
Member
ARR8 began at the beginning.
 
Posts: 19
Karma: 20
Join Date: Aug 2025
Device: PocketBook Verse Pro
Yes, this is interesting. Tl;dr: I'll upload a fix. Some technical details follow.

The log suggests that the outdated version of the cloudscraper module integrated with Kobo Metadata is interfering with the one I've packaged. I don't get the error when testing locally without Kobo Metadata installed and in fact can reproduce it if I do install Kobo Metadata.

Calibre does implement a sort of isolated namespacing for plugin imports, but both plugins concerned bypass it because it breaks packaged modules' importing their own dependencies (this was by far the trickiest part of the 2.0 update). That's the immediate source of the issue.

It looks like the way Calibre loads plugins is deterministic and alphabetical. If I rename my plugin to come before Kobo, it loads the newer version and works perfectly. However, the option I've specified, auto_refresh_on_403, is necessary when using the newer version with Calibre and Kobo Metadata not specifying it means that it hangs instead of returning on failure.

The quickest fix for this is for me to rename my copy of the module, which will fix the immediate issue, and which I will do shortly. However, both the Kobo plugin and mine include second-order dependencies which would be nontrivial to rename and apparently have become a time bomb if either of us update one to an incompatible version, though they seem to be working together fine for now.

The long-term fix would have to be on the Calibre side. Bypassing its namespacing is the only way to make the modules work, short of running a script to rewrite all imports, but that doesn't have to be the case. I can understand that this isn't high-priority, though.

There's a medium-term fix where all plugin developers using this import method make an effort to keep library versions in sync, but I don't regard that as a serious option.
ARR8 is offline   Reply With Quote