GNU bug report logs - #70815
[PATCH] ; Enahnce python-tests.el to adapt different python interpreters

Previous Next

Package: emacs;

Reported by: Lin Sun <sunlin7.mail <at> gmail.com>

Date: Tue, 7 May 2024 06:54:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #64 received at 70815 <at> debbugs.gnu.org (full text, mbox):

From: kobarity <kobarity <at> gmail.com>
To: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Lin Sun <sunlin7.mail <at> gmail.com>,
 stefankangas <at> gmail.com, 70815 <at> debbugs.gnu.org
Subject: Re: bug#70815: [PATCH] ;
 Enahnce python-tests.el to adapt different python interpreters
Date: Sun, 26 May 2024 23:15:50 +0900
Mattias EngdegÄrd wrote:
> 
> 26 maj 2024 kl. 14.36 skrev kobarity <kobarity <at> gmail.com>:
> 
> > Sorry, I forgot that native completion does not work on Mac, even with
> > Python 3.  What I wanted to know is if there is unexpected echo backs
> > with Python 2 on Mac.
> 
> Not that I can see when running an interactive Python shell in Emacs, no.

Could you see what is returned when you enter the following line in
Inferior Python buffer running Python 2 on Mac?

__PYTHON_EL_eval("print(\"Hello\")\n", "")

> > Maybe it is better to prefer "python3", but I don't know if that would
> > reliably prevent the problem.  The best way would be to skip some
> > tests if the selected interpreter is Python 2 and it is running on
> > Mac.
> 
> Why select Python 2 in the first place? Is it more important to test Python 2 than Python 3 on other platforms?

I am not saying that Python 2 (or simple "python") should be the
first.  I do agree that "python3" should be preferred than "python".

My point is that we cannot assure that Python 2 is not selected.  One
example is EMACS_PYTHON_INTERPRETER environment variable introduced by
the patch.  It can specify the interpreter used in ERTs.  So a Mac
user may set EMACS_PYTHON_INTERPRETER to "python".

I wrote in the previous mail:

> As for EMACS_PYTHON_INTERPRETER, I am a little doubtful that it is the
> right thing to introduce.  It allows the ERT runner to specify the
> interpreter.  It's OK for ERTs that can be run on both Python 2 and 3,
> but you may want to write an ERT that can only be run on Python 3.

At the time of writing, I assumed that current ERTs can be run on both
Python 2 and 3 on all platforms.  However, it turned out that it was
wrong.  Some tests fail with Python 2 on Mac.  So I think we need some
mechanism to skip test based on the interpreter version and the
platform.




This bug report was last modified 1 year and 41 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.