Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load DeDRM_calibre_plugin with calibre 4.1 on Fedora 31 #928

Open
xjvs opened this issue Oct 31, 2019 · 5 comments

Comments

@xjvs
Copy link

@xjvs xjvs commented Oct 31, 2019

Hi,

I'm running calibre 4.1 on Fedora 31 which has Python3 as default, while loading "DeDRM_plugin.zip", I got error messages as below:

calibre, version 4.1.0
ERROR: Unhandled exception: <b>SyntaxError</b>:invalid syntax (calibre_plugins.dedrm.__init__, line 167)

calibre 4.1  embedded-python: False is64bit: True
Linux-5.3.7-301.fc31.x86_64-x86_64-with-fedora-31-Thirty_One Linux ('64bit', 'ELF')
('Linux', '5.3.7-301.fc31.x86_64', '#1 SMP Mon Oct 21 19:18:58 UTC 2019')
Python 3.7.4
Linux: ('Fedora', '31', 'Thirty One')
Interface language: en_GB
Traceback (most recent call last):
  File "/usr/lib64/calibre/calibre/gui2/preferences/plugins.py", line 318, in add_plugin
    plugin = add_plugin(path)
  File "/usr/lib64/calibre/calibre/customize/ui.py", line 472, in add_plugin
    plugin = load_plugin(path_to_zip_file)
  File "/usr/lib64/calibre/calibre/customize/ui.py", line 61, in load_plugin
    return loader.load(path_to_zip_file)
  File "/usr/lib64/calibre/calibre/customize/zipplugin.py", line 202, in load
    m = importlib.import_module(plugin_module)
  File "/usr/lib64/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/usr/lib64/calibre/calibre/customize/zipplugin.py", line 180, in load_module
    import_name), 'exec', dont_inherit=True)
  File "calibre_plugins.dedrm.__init__", line 167
    print u"{0} v{1}: Copying needed library files from plugin's zip".format(PLUGIN_NAME, PLUGIN_VERSION)
                                                                    ^
SyntaxError: invalid syntax

And this is the calibre info:

$ calibre-debug -g
QSocketNotifier: Can only be used with threads started with QThread
calibre 4.1  embedded-python: False is64bit: True
Linux-5.3.7-301.fc31.x86_64-x86_64-with-fedora-31-Thirty_One Linux ('64bit', 'ELF')
('Linux', '5.3.7-301.fc31.x86_64', '#1 SMP Mon Oct 21 19:18:58 UTC 2019')
Python 3.7.4
Linux: ('Fedora', '31', 'Thirty One')
Interface language: en_GB
Turning on automatic hidpi scaling
devicePixelRatio: 1.0
logicalDpi: 96.0 x 96.0
physicalDpi: 157.31612903225806 x 161.36470588235292
Using calibre Qt style: True

It seems the DeDRM plugin only support python2, is there a workaround for me to load and enable the plugin? Fedora 31 has Python3.7 as default, but Python2.7 is also available.

@j-howell

This comment has been minimized.

Copy link

@j-howell j-howell commented Oct 31, 2019

I don’t know about the DeDRM plugin in particular, but Calibre is currently a python 2 application. Work is underway to make it Python 3 compliant, but it is not yet complete and I suspect that many plugins won’t be updated until Calibre itself is ready.

See https://calibre-ebook.com/download_linux for info about installing under Linux.

@xjvs

This comment has been minimized.

Copy link
Author

@xjvs xjvs commented Nov 1, 2019

I don’t know about the DeDRM plugin in particular, but Calibre is currently a python 2 application. Work is underway to make it Python 3 compliant, but it is not yet complete and I suspect that many plugins won’t be updated until Calibre itself is ready.

This is not true, Calibre already supports Python 3, at least on my system (Fedora 31) Calibre 4.1 is built and running with Python 3.

Seems there is no workaround to load DeDRM from Python 3 Calibre. Hi DeDRM maintainers, is there any plan on supporting Python 3 for DeDRM_calibre_plugin?

@rrix

This comment has been minimized.

Copy link

@rrix rrix commented Nov 3, 2019

Doing nothing but running 2to3 on the codebase provides nearly 9000 lines in changes, this doesn't seem like a trivial undertaking to actually get it working.

I guess a work around would be to try to get a calibre flatpak running it under py2 ? I don't know if the hardware support would work though.

@audetto

This comment has been minimized.

Copy link

@audetto audetto commented Nov 7, 2019

I can only confirm it.
And installing the F30 rpm does not work either.

@audetto

This comment has been minimized.

Copy link

@audetto audetto commented Nov 7, 2019

It is massive pain, but boxes and F30 came to the rescue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.