Installation fails on OpenSUSE Leap 15.1 when Python3 is installed

Bug #1851873 reported by A. Asieoniezi on 2019-11-08
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Trying to install Calibre 4.3.0 on Linux, OpenSUSE Leap 15.1.

I'm using the recommended and supported way of installing Calibre as suggested by, with this result:

> sudo -v && wget -nv -O- | sudo sh /dev/stdin
[sudo] password for root:
Using python executable: /usr/bin/python3
2019-11-08 19:02:19 URL: [31888/31888] -> "-" [1]
Installing to /opt/calibre
Downloading tarball signature securely...
Will download and install calibre-4.3.0-x86_64.txz
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 800, in script_launch
  File "<string>", line 756, in main
  File "<string>", line 699, in run_installer
  File "<string>", line 670, in download_and_extract
  File "<string>", line 354, in download_tarball
  File "<string>", line 291, in do_download
  File "<string>", line 238, in __init__
  File "<string>", line 119, in __init__
  File "<string>", line 168, in _tigetstr
  File "/usr/lib64/python3.6/", line 191, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: sequence item 1: expected str instance, bytes found
Exit 1

Using sh -x reveals that the script selects /usr/bin/python3 as its Python binary. Changing to select /usr/bin/python2 allows the installation procedure to succeed.

The installer is carefully designed to work with both python2 and
python3, but apparently this particular part of it never got run by
anyone on python3 before, wow!

This should fix it though:

Direct link to the raw version, which you should be able to download,
compare to the official version, then run with sudo sh
./ -- does this fix your issue?

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

 status fixreleased

Changed in calibre:
status: New → Fix Released
A. Asieoniezi (asieoniezi) wrote :

I can confirm that the fixed now works on my system, with both Python versions, 2 and 3.

Thank you for the quick fix!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers