Installation fails on OpenSUSE Leap 15.1 when Python3 is installed

Bug #1851873 reported by A. Asieoniezi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

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 https://calibre-ebook.com/download_linux, with this result:

> sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin
[sudo] password for root:
Using python executable: /usr/bin/python3
2019-11-08 19:02:19 URL:https://download.calibre-ebook.com/linux-installer.sh [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/re.py", 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 linux-installer.sh to select /usr/bin/python2 allows the installation procedure to succeed.

Revision history for this message
Eli Schwartz (eschwartz) wrote : Re: [Bug 1851873] [NEW] Installation fails on OpenSUSE Leap 15.1 when Python3 is installed

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: https://github.com/kovidgoyal/calibre/pull/1068

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

https://github.com/eli-schwartz/calibre/raw/linux-installer-bug1851873/setup/linux-installer.sh

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 alternate Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
Revision history for this message
A. Asieoniezi (asieoniezi) wrote :

I can confirm that the fixed linux-installer.sh 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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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