texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] python -> python2


From: Darcy Shen
Subject: Re: [Texmacs-dev] python -> python2
Date: Mon, 27 Jul 2020 22:53:37 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Most of the python scripts are maintained by me(Darcy Shen).


$ git grep "env python3"

misc/admin/pr:#!/usr/bin/env python3
plugins/tmpy/session/tm_tikz.py:#!/usr/bin/env python3


I found that two of the python scripts use "#!/usr/bin/env python3", I will fix it later.

Currently, we use Python 2 as an alternative to run the python scripts.

We will try to keep Python 2 compatibility, but Python 3 is preferred.


On 2020/7/27 上午4:30, Sebastian Miele wrote:
On current Arch Linux, 'python --version' reports 'Python 3.8.3'. The
most recent Arch Linux package for TeXmacs contains TeXmacs 1.99.12. Its
PKGBUILD contains:

   find -name '*.py' | xargs sed -i 's/env python/env python2/'

The first line produces incorrect results on the current trunk/src,
because today there are python scripts with 'env python3', which
gets changed to 'env python23'.

I do not know Python. But I suspect that something like the
following is the case: In the past, just 'python' unambiguously
meant Python 2. At least on some systems there was no 'python2',
even if Python 2 was installed. Because of that 'python' was used
instead of 'python2' in TeXmacs.

Today the situation is different: Just 'python' means Python 3 at
least on Arch Linux. I strongly suspect that assumption A holds,
where A is: On recent systems, installing Python 2 always provides
a 'python2' in the path. If not, it can be considered to be a bug
of that system.

In fact, files like plugins/xypic/progs/init-xypic.scm today
consistently contain:

   (define (python-command)
     (if (url-exists-in-path? "python3") "python3" "python2"))

   (define (python-exists?)
     (or (url-exists-in-path? "python3")
         (url-exists-in-path? "python2")))

I do not understand the details. But almost certainly it means: A
already is assumed there.

Therefore I recommend the following: Run

: find -name '*.py' | xargs sed -i 's/env python$/env python2/'

(note the added '$') on trunk/svn and commit.

_______________________________________________
Texmacs-dev mailing list
Texmacs-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/texmacs-dev




reply via email to

[Prev in Thread] Current Thread [Next in Thread]