Package: lyx
Version: 2.3.2-1
Severity: normal

lyx --export latex someFile.lyx outputs loads of errors, with this pattern:

Traceback (most recent call last):
  File "/usr/share/lyx/scripts/convertDefault.py", line 38, in <module>
    output = output.decode()
AttributeError: 'str' object has no attribute 'decode'

PLease consider applying the attached patch, which fixes those errors.



-- System Information:
Debian Release: buster/sid
  APT prefers stable
  APT policy: (900, 'stable'), (499, 'testing'), (400, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.18.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), 
LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages lyx depends on:
ii  libc6            2.28-2
ii  libenchant1c2a   1.6.0-11.1+b1
ii  libgcc1          1:8.2.0-12
ii  libmagic1        1:5.34-2
ii  libmythes-1.2-0  2:1.2.4-3
ii  libqt5core5a     5.11.2+dfsg-7
ii  libqt5gui5       5.11.2+dfsg-7
ii  libqt5svg5       5.11.2-2
ii  libqt5widgets5   5.11.2+dfsg-7
ii  libstdc++6       8.2.0-12
ii  lyx-common       2.3.2-1
ii  xdg-utils        1.1.3-1
ii  zlib1g           1:1.2.11.dfsg-1

Versions of packages lyx recommends:
ii  dvipng                           1.15-1.1
ii  evince [pdf-viewer]              3.30.2-1
ii  fonts-lyx                        2.3.2-1
ii  ghostscript                      9.26~dfsg-0+deb9u2
ii  imagemagick                      8:6.9.10.14+dfsg-7
ii  imagemagick-6.q16 [imagemagick]  8:6.9.10.14+dfsg-7
ii  okular [pdf-viewer]              4:17.12.2-2.1
ii  poppler-utils                    0.69.0-2
ii  preview-latex-style              11.91-2
ii  psutils                          1.17.dfsg-4
ii  texlive-fonts-recommended        2018.20181214-1
ii  texlive-generic-extra            2018.20181214-1
ii  texlive-generic-recommended      2018.20181214-1
ii  texlive-latex-extra              2018.20181214-1
ii  texlive-latex-recommended        2018.20181214-1
ii  texlive-science                  2018.20181214-1

Versions of packages lyx suggests:
pn  chktex                          <none>
pn  gnuhtml2latex                   <none>
pn  groff                           <none>
ii  inkscape                        0.92.3-7
pn  latex2rtf                       <none>
ii  librsvg2-bin                    2.44.10-1
pn  libtiff-tools                   <none>
pn  linuxdoc-tools                  <none>
pn  noweb                           <none>
pn  rcs                             <none>
pn  sgmltools-lite                  <none>
ii  tex4ht                          20160814-1
ii  texlive-plain-generic [tex4ht]  2018.20181214-1
ii  texlive-xetex                   2018.20181214-1
pn  writer2latex                    <none>
pn  wv                              <none>

-- no debconf information
The newest version of Python3 yields str types when one calls os.popen('somme 
command').readline()
So, the test is now to know whether Python is 2 or 3, it is just to know 
whether the output is
of type str or not.

Index: lyx-2.3.2/lib/scripts/convertDefault.py
===================================================================
--- lyx-2.3.2.orig/lib/scripts/convertDefault.py
+++ lyx-2.3.2/lib/scripts/convertDefault.py
@@ -19,8 +19,6 @@
 from __future__ import print_function
 import os, re, sys
 
-PY2 = sys.version_info[0] == 2
-
 # We may need some extra options only supported by recent convert versions
 re_version = re.compile(r'^Version:.*ImageMagick\s*(\d*)\.(\d*)\.(\d*).*$')
 # imagemagick 7
@@ -34,7 +32,7 @@ if fout.close() != None:
     fout = os.popen('convert -version 2>&1')
     output = fout.readline()
     fout.close()
-if not PY2:
+if type(output) != str:
     output = output.decode()
 
 version = re_version.match(output)

Reply via email to