From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?TWFydMOtbiBGZXJuw6FuZGV6?= Newsgroups: gmane.emacs.devel Subject: Re: python-mode: Why python-interpreter defaults to "python" instead of looking for python/python3 Date: Thu, 16 Mar 2023 11:29:28 -0300 Message-ID: References: <874jqv3uab.fsf@gmail.com> <87ilf1atyx.fsf@gmail.com> <87o7otf19h.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40378"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Augusto Stoffel , emacs-devel@gnu.org To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 16 15:48:25 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcou0-000AI9-NO for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Mar 2023 15:48:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcot5-0001yA-4Q; Thu, 16 Mar 2023 10:47:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcobo-0004uM-Aa for emacs-devel@gnu.org; Thu, 16 Mar 2023 10:29:36 -0400 Original-Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pcobm-0007BS-86 for emacs-devel@gnu.org; Thu, 16 Mar 2023 10:29:35 -0400 Original-Received: by mail-pl1-x636.google.com with SMTP id o11so1960471ple.1 for ; Thu, 16 Mar 2023 07:29:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678976971; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=o3IRdluyoAPuiyTdG6XG9IfP44IKNSa25C4VLRNz0/0=; b=qySL+c0lwQXhp9e30wDAzlLxz+c9OpEjUYTZk2wxlDG97UC1nJoglVJY+PJcsHYdU/ ciVrgt3+KiP4wvp1PDEZFK1SZwxaPHgZlgZtNWu5vkPtbwRWbnqG8y70mPqLK+cQDsjQ VVjbWN8YZS6GiW1fMTy8beWzyKSPrkgACb5h5igOIGsFReOkrYDsJka2OTguiFLhdxZf gdbevlgdbkwhFeBjZtK+VjFNg7J6hp0sozPFbnHC4VQwUdSrq9dSszWRrjPbsHp5BsgM zwI7N6e2e7n9acFjJ/hrzuSxxqz7b0Sq7uujIBS9EnNPNUr6TH5C7vVd0ltK7b1VS7Zz pzRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678976971; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o3IRdluyoAPuiyTdG6XG9IfP44IKNSa25C4VLRNz0/0=; b=02vT4MYU7GKGf5YGqaCREjgUPK6tbmkThGGlXNjORKbmWAnZ0YmKqamvFUQnvDLJYt H8sK6x5o50356ZnBH/+wdkYpuXK9SZ45vucdDbJOp0iHG0m5jzCSiEQnlB4oMsdyOaYI 4qFSlvu2bpfLFDuA2ITBe1JSalzwGfafXw3eKJCXSC5wcG503U6FZyxZwhSzZjSLNhy/ XmgiT3ZBHoESR2Nw8vlaZgXdWtxDl/d58LE28K4r16lYkPzJ1dgz8DXKDBQoE9JgsHNz e1/wfpjEvKcb3YjGRUrG0XHcGqR1SkILONAd/NBw9GSs8waSaM+G5FGP0mVNogPMzf+2 0rTw== X-Gm-Message-State: AO0yUKWjNdAvrLDA+1IkqemfUG/z748mYBVcE2ya5CCdYVhWuu6msuWe IQTsn3oy0VE2YvZA9m+wXriQyTnBOuuTARSga8w= X-Google-Smtp-Source: AK7set9woNf84jUVj1zRborFlG5I/GuSQtNp+ig4c4BNksTCctG2IUg/icYLDru4Z7tr1m8aregvagByQSbCjCxrpNQ= X-Received: by 2002:a17:90a:c38d:b0:23d:32f9:93f8 with SMTP id h13-20020a17090ac38d00b0023d32f993f8mr1209075pjt.0.1678976971360; Thu, 16 Mar 2023 07:29:31 -0700 (PDT) Original-Received: by 2002:a05:6a10:ed15:b0:45a:4c9e:5d84 with HTTP; Thu, 16 Mar 2023 07:29:28 -0700 (PDT) In-Reply-To: <87o7otf19h.fsf@posteo.net> Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=tinchofernandez97@gmail.com; helo=mail-pl1-x636.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 16 Mar 2023 10:47:25 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304526 Archived-At: On 3/16/23, Philip Kaludercic wrote: > Augusto Stoffel writes: > >> Hi again Mart=C3=ADn, >> >> On Wed, 8 Mar 2023 at 20:41, Augusto Stoffel wrote: >> >>> On Wed, 8 Mar 2023 at 11:03, Mart=C3=ADn Fern=C3=A1ndez 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. I think because it's already done for the interpreter variable, why is that different? And yes, I'm a debian user, and `python` runs python2. So yes, it's consistency and convince (for me). But to be honest, the more I think about it, the more I think that it should be set on a per project basis. But again, then I would remove the logic on the interpreter variable and just default to "python", as you mentioned. What do you think? Do you know what the history is for the logic on the interpreter variable and why it wasn't implemented on the cmdline variable? > > 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 > Oh I didn't know that! Thank you! >> >> 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'. >