Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#59600 - [lyx] Reconfigure should use Python 2, not Python 3

Attached to Project: Arch Linux
Opened by Moabit (Moabit) - Friday, 10 August 2018, 09:52 GMT
Last edited by freswa (frederik) - Sunday, 13 September 2020, 10:09 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Ronald van Haren (pressh)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:
Attempting to reconfigure LyX fails with the following on the command line:
```
LyX: reconfiguring user directory
File "/usr/share/lyx/configure.py", line 60
def cmdOutput(cmd, async = False):
^
SyntaxError: invalid syntax
Systemcall.cpp (294): Systemcall: 'python -tt "/usr/share/lyx/configure.py" --binary-dir="/usr/bin/"' finished with exit code 1
LyX: Done!
```

This is because Arch uses Python 3 by default, while LyX expects Python 2. A workaround is to reconfigure on the command line, calling Python 2 specifically. i.e.
```
$ cd ~/.lyx
$ python2 /usr/share/lyx/configure.py
```

Additional info:
* package version(s): 2.3.0-1

Steps to reproduce:
Select menu: `Tools` > `Reconfigure`
This task depends upon

Closed by  freswa (frederik)
Sunday, 13 September 2020, 10:09 GMT
Reason for closing:  Fixed
Comment by Eli Schwartz (eschwartz) - Wednesday, 15 August 2018, 19:03 GMT
  • Field changed: Status (Unconfirmed → Assigned)
  • Field changed: Category (Packages: Extra → Upstream Bugs)
  • Task assigned to Ronald van Haren (pressh)
$ arch-nspawn /var/lib/archbuild/extra-x86_64/eschwartz
# DISPLAY=:0 lyx reconfigure

Without python installed, but with python2 installed:

LyX: Creating directory /root/.lyx/
Looking for python v2.x or 3.x ...
Examining /usr/bin/python2
Found Python 2.7.15

LyX: reconfiguring user directory
checking for a Latex2e program...

With both installed:

LyX: Creating directory /root/.lyx/
LyX: reconfiguring user directory
File "/usr/share/lyx/configure.py", line 60
def cmdOutput(cmd, async = False):
^
SyntaxError: invalid syntax
Systemcall.cpp (294): Systemcall: 'python -tt "/usr/share/lyx/configure.py" --binary-dir="/usr/bin/"' finished with exit code 1
LyX: Done!


...

That's just every type of backwards, it checks for python first then falls back on python2? They explicitly list the requirements as: "Python: Required for configuration and conversion scripts. Tested with version 2.7. Python 3.0 is work in progress."
So why are they set up to prefer the latter?
Comment by Yanestrb (Yanestrb) - Monday, 13 May 2019, 14:12 GMT
Same reason, different error:

$ lyx

checking LaTeX configuration... default values
+checking list of textclasses...
Traceback (most recent call last):
File "/usr/share/lyx/configure.py", line 1904, in <module>
ret = checkLatexConfig(lyx_check_config and LATEX != '', bool_docbook)
File "/usr/share/lyx/configure.py", line 1384, in checkLatexConfig
retval = processLayoutFile(file, bool_docbook)
File "/usr/share/lyx/configure.py", line 1332, in processLayoutFile
% (classname, opt, desc, avai, prereq))
TypeError: %b requires a bytes-like object, or an object that implements __bytes__, not 'str'
Systemcall.cpp (276): Systemcall: 'python -tt "/usr/share/lyx/configure.py" --binary-dir="/usr/bin/"' finished with exit code 1
LyX: Done!
LayoutFile.cpp (172): LayoutFileList::Read: no textclasses found!

Comment by Yanestrb (Yanestrb) - Monday, 13 May 2019, 22:55 GMT
Pls consider dropping the port completely - it hasn't much sense to keep it if it doesn't work. And no, it's not exactly an upstream bug because upstream simply relies on a different system layout.

Loading...