"TypeError: QPixmap(): argument 1 has unexpected type" – incompatibility with Qt 5.4.1?

Bug #1427684 reported by drunken monkey
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

The problem was already described in several places over the web:
http://www.mobileread.com/forums/showthread.php?t=256756
http://osquestions.com/unix-linux/187763/calibre-dont-convert-from-epub-to-mobi

It seems to occur mainly for Arch users after the latest updates, but it will probably also occur for other users who are using the newest Qt version (5.4.1).

The problem, at least for me, manifests itself in at least two ways:

When I try to edit a book individually with the popup form, the following error is thrown (instead of the popup form appearing):
  Traceback (most recent call last):
    File "/usr/lib/calibre/calibre/gui2/actions/edit_metadata.py", line 294, in edit_metadata
      self.edit_metadata_for(row_list, ids, bulk=bulk)
    File "/usr/lib/calibre/calibre/gui2/actions/edit_metadata.py", line 317, in edit_metadata_for
      changed, rows_to_refresh = self.do_edit_metadata(row_list, current_row, editing_multiple)
    File "/usr/lib/calibre/calibre/gui2/actions/edit_metadata.py", line 342, in do_edit_metadata
      set_current_callback=self.set_current_callback, editing_multiple=editing_multiple)
    File "/usr/lib/calibre/calibre/gui2/metadata/single.py", line 1105, in edit_metadata
      d = editors[cls](db, parent, editing_multiple=editing_multiple)
    File "/usr/lib/calibre/calibre/gui2/metadata/single.py", line 52, in __init__
      ResizableDialog.__init__(self, parent)
    File "/usr/lib/calibre/calibre/gui2/__init__.py", line 830, in __init__
      self.setupUi(self)
    File "/usr/lib/calibre/calibre/gui2/metadata/single.py", line 103, in setupUi
      self.create_basic_metadata_widgets()
    File "/usr/lib/calibre/calibre/gui2/metadata/single.py", line 197, in create_basic_metadata_widgets
      self.cover = Cover(self)
    File "/usr/lib/calibre/calibre/gui2/metadata/basic_widgets.py", line 1013, in __init__
      ImageView.__init__(self, parent, show_size_pref_name='edit_metadata_cover_widget', default_show_size=True)
    File "/usr/lib/calibre/calibre/gui2/widgets.py", line 298, in __init__
      self._pixmap = QPixmap(self)
  TypeError: QPixmap(): argument 1 has unexpected type 'Cover'
When I edit the book by clicking twice on title, author or some other field, everything works normally. The same goes for editing several books in bulk. Displaying the window with the edit form seems to be the problem.

Also, when I try to convert a book via the UI, this error is triggered:
  Traceback (most recent call last):
    File "/usr/lib/calibre/calibre/gui2/device.py", line 1257, in dispatch_sync_event
      self.sync_to_device(on_card, delete, fmt)
    File "/usr/lib/calibre/calibre/gui2/device.py", line 1531, in sync_to_device
      self.iactions['Convert Books'].auto_convert(auto, on_card, format)
    File "/usr/lib/calibre/calibre/gui2/actions/convert.py", line 76, in auto_convert
      jobs, changed, bad = convert_single_ebook(self.gui, self.gui.library_view.model().db, book_ids, True, format)
    File "/usr/lib/calibre/calibre/gui2/tools.py", line 41, in convert_single_ebook
      d = SingleConfig(parent, db, book_id, None, out_format)
    File "/usr/lib/calibre/calibre/gui2/convert/single.py", line 151, in __init__
      self.setup_pipeline()
    File "/usr/lib/calibre/calibre/gui2/convert/single.py", line 201, in setup_pipeline
      self.mw = widget_factory(MetadataWidget)
    File "/usr/lib/calibre/calibre/gui2/convert/single.py", line 199, in widget_factory
      self.plumber.get_option_help, self.db, self.book_id)
    File "/usr/lib/calibre/calibre/gui2/convert/metadata.py", line 55, in __init__
      Widget.__init__(self, parent, ['prefer_metadata_cover'])
    File "/usr/lib/calibre/calibre/gui2/convert/__init__.py", line 62, in __init__
      self.setupUi(self)
    File "/usr/lib/calibre/calibre/gui2/convert/metadata_ui.py", line 51, in setupUi
      self.cover = ImageView(self.groupBox_4)
    File "/usr/lib/calibre/calibre/gui2/widgets.py", line 298, in __init__
      self._pixmap = QPixmap(self)
  TypeError: QPixmap(): argument 1 has unexpected type 'ImageView'
Converting by running ebook-convert on the command line works fine.

Versions:
  calibre: 2.20.0-1
  Qt: 5.4.1-2
  pyqt5: 5.4.1-1
OS: Linux 3.18.6-1-ARCH (x86_64)

Revision history for this message
czsan (czirbusz) wrote :

This is a very serious error; it makes to impossible to convert document or edit metadata.

Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

Fixed in branch master. The fix will be in the next release. calibre is usually released every Friday.

 status fixreleased

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.