crash in edit book due to pyqt API change

Bug #1586124 reported by Andreas Metzler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

Hello,

this is https://bugs.debian.org/823134 originally reported by Douglas Perkins:
------------------------------------------
After a update and upgrade in late April 2016, editing in Calibre stopped working.

If I open Calibre, right-click and edit an ePub book stored there, and then try to open an HTML file in the book, I get a pop-up error message.

---

calibre, version 2.55.0
ERROR: Unhandled exception: <b>AttributeError</b>:type object 'QUrl' has no attribute 'None'

calibre 2.55 embedded-python: False is64bit: True
Linux-4.4.0-1-amd64-x86_64-with-debian-stretch-sid Linux ('64bit', 'ELF')
('Linux', '4.4.0-1-amd64', '#1 SMP Debian 4.4.2-3 (2016-02-21)')
Python 2.7.11+
Linux: ('debian', 'stretch/sid', '')
Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/gui2/tweak_book/preview.py", line 224, in createRequest
    url = unicode(request.url().toString(QUrl.None))
AttributeError: type object 'QUrl' has no attribute 'None'

---

After I click OK for the error message popup, Calibre closes.
-------------------------------------------

Tobias Brink later added this information:
-------------------------------------------
The problem seems to be related to a recent python-pyqt5 update to version 5.6.
They seem to have helpfully broken the API: "PyQt5.Qt.QUrl.None" is now named
"PyQt5.Qt.QUrl.None_" as far as I can see. Great. Maybe there are other
problems after fixing this one, too, the upstream changelog for pyqt5 does not
mention this from what I can tell at a quick glance.
[...]
BTW, if you need a quick hack to fix this, run the following as root:

dpkg -L calibre | grep py$ | xargs sed -i 's/QUrl\.None/QUrl.None_/g'

Warning: This will edit the package's files (see debsums errors in the
information below). Still, this makes the program usable until the next update.
-------------------------------------------

Bug was reported against 2.55, but afaict GIT head has no changes related to the issue.

Thanks, cu Andreas

Revision history for this message
Eli Schwartz (eschwartz) wrote :
Changed in calibre:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.