calibre_plugins icon indicating copy to clipboard operation
calibre_plugins copied to clipboard

Goodreads Sync - PROXY_TYPE_HTTP_NO_TUNNEL error on MacOS

Open Mdejonge opened this issue 11 months ago • 3 comments

When I want to configure Goodreads sync I get the following error message:

Tried to uninstall and install the plugin but without any succes.

calibre, version 7.23.0
ERROR: Unhandled exception: <b>AttributeError</b>:'NoneType' object has no attribute 'PROXY_TYPE_HTTP_NO_TUNNEL'

calibre 7.23  embedded-python: True
macOS-15.2-arm64-arm-64bit Darwin ('64bit', '')
('Darwin', '24.2.0', 'Darwin Kernel Version 24.2.0: Fri Dec  6 19:01:59 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6000')
Python 3.11.5
OSX: ('15.2', ('', '', ''), 'arm64')
Interface language: None
EXE path: /Applications/calibre.app/Contents/MacOS/calibre
Successfully initialized third party plugins: Goodreads Sync (1, 16, 11) && Kobo Utilities (2, 17, 2) && KoboTouchExtended (3, 7, 3) && Libgen Fiction (0, 4, 3) && Library Genesis (1, 2, 0)
Traceback (most recent call last):
  File "calibre/gui2/preferences/plugins.py", line 295, in double_clicked
  File "calibre/gui2/preferences/plugins.py", line 375, in modify_plugin
  File "calibre/customize/__init__.py", line 160, in do_user_config
  File "calibre_plugins.goodreads_sync.__init__", line 60, in config_widget
    grhttp = HttpHelper(self.actual_plugin_.gui)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "calibre_plugins.goodreads_sync.core", line 93, in __init__
    proxy_type = httplib2.socks.PROXY_TYPE_HTTP_NO_TUNNEL
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'PROXY_TYPE_HTTP_NO_TUNNEL'

Mdejonge avatar Jan 09 '25 10:01 Mdejonge

I don't have a MacOS machine to offer any comment on whether this plugin does actually work on that OS. I suggest you ask in the MobileRead forum plugin thread to see if any other Max users out there.

kiwidude68 avatar Jan 09 '25 10:01 kiwidude68

A fix is on the way 😁

GwynethLlewelyn avatar Feb 12 '25 14:02 GwynethLlewelyn

For reference for anyone that later visits this issue (or myself with goldfish memory) - I have not accepted the PR above as it is too bespoke and I don't want to have to support it, thanks @GwynethLlewelyn for taking a stab at it anyway. If you are desperate for a version on MacOS that works around this issue, I am told his branch is currently working so feel free to create your own personal use build from it.

The long term fix will be to use a later version of the httplib2 library, however this is blocked currently because calibre 7.x uses an older python version than what httplib2 requires. When calibre 8.x is released it is possible Kovid will have updated his bundled python libraries with calibre and then it might be possible to upgrade httplib2 without plugin specific patches to it.

kiwidude68 avatar Feb 21 '25 08:02 kiwidude68