unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Augusto Stoffel <arstoffel@gmail.com>
Cc: "Martín Fernández" <tinchofernandez97@gmail.com>, emacs-devel@gnu.org
Subject: Re: python-mode: Why python-interpreter defaults to "python" instead of looking for python/python3
Date: Thu, 16 Mar 2023 10:18:02 +0000	[thread overview]
Message-ID: <87o7otf19h.fsf@posteo.net> (raw)
In-Reply-To: <87ilf1atyx.fsf@gmail.com> (Augusto Stoffel's message of "Thu, 16 Mar 2023 11:09:10 +0100")

Augusto Stoffel <arstoffel@gmail.com> writes:

> Hi again Martín,
>
> On Wed,  8 Mar 2023 at 20:41, Augusto Stoffel wrote:
>
>> On Wed,  8 Mar 2023 at 11:03, Martín Fernández wrote:
>>
>>> Hey,
>>>
>>> I'm wondering why there is no logic to find the latest python
>>> executable installed (python vs python3) when setting
>>> `python-interpreter`, as it is done with `python-shell-interpreter`.
>>>
>>> I think it should be added, but since it is a straightforward change I
>>> assume there are reasons for it. Otherwise I'm happy to send a patch.
>
> Can you expand a bit on why you think so?  I just noticed that Debian
> doesn't provide a `python' command by default, so indeed some logic
> might be needed.  

That depends on your version.  According to [0], Debian 11 has a package
called "python2-is-python" that just create a symlink between python and
python2.  This has been removed with Debian 12, now you'd have to
install python-is-python3 to have python symlink'ed to python3.

[0] https://wiki.debian.org/Python/FAQ#Python_2_support

>                   
>                   But then it should look for python, then python3, and
> finally fall back to python.  Still, doing so has its downsides, as I
> mentioned in my previous message.
>
>> IMO the logic to choose `python-shell-interpreter' is misguided.  The
>> default value should be just "python", since if you are doing anything
>> with Python and "python" doesn't point to the right version, then you
>> are in trouble anyway.  OTOH, if you really need to work with Python 2
>> and symlink "python" accordingly then the current default proactively
>> puts you in trouble.
>>
>> Personally I'd be happy to see a patch fixing `python-shell-interpreter'.



  reply	other threads:[~2023-03-16 10:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08 14:03 python-mode: Why python-interpreter defaults to "python" instead of looking for python/python3 Martín Fernández
2023-03-08 19:41 ` Augusto Stoffel
2023-03-16 10:09   ` Augusto Stoffel
2023-03-16 10:18     ` Philip Kaludercic [this message]
2023-03-16 14:29       ` Martín Fernández
2023-03-16 18:13         ` Augusto Stoffel
2023-03-16 18:17       ` Augusto Stoffel
2023-03-16 18:45         ` Yuri Khan
2023-03-17 19:32           ` chad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o7otf19h.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=arstoffel@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=tinchofernandez97@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).