From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Balint Reczey Newsgroups: gmane.emacs.bugs Subject: bug#45655: Please use 'python3' command instead of 'python' Date: Wed, 6 Jan 2021 18:47:48 +0100 Message-ID: References: <5kczyim26n.fsf@fencepost.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30990"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 45655@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 06 18:56:14 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kxD2c-0007wW-Fg for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Jan 2021 18:56:14 +0100 Original-Received: from localhost ([::1]:52448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxD2b-0007XW-A6 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Jan 2021 12:56:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxD2Q-0007W6-Fs for bug-gnu-emacs@gnu.org; Wed, 06 Jan 2021 12:56:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33899) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kxD2Q-0005kc-8m for bug-gnu-emacs@gnu.org; Wed, 06 Jan 2021 12:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kxD2Q-00051z-7f for bug-gnu-emacs@gnu.org; Wed, 06 Jan 2021 12:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Balint Reczey Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Jan 2021 17:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45655 X-GNU-PR-Package: emacs Original-Received: via spool by 45655-submit@debbugs.gnu.org id=B45655.160995574619317 (code B ref 45655); Wed, 06 Jan 2021 17:56:02 +0000 Original-Received: (at 45655) by debbugs.gnu.org; 6 Jan 2021 17:55:46 +0000 Original-Received: from localhost ([127.0.0.1]:45445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kxD29-00051U-Ox for submit@debbugs.gnu.org; Wed, 06 Jan 2021 12:55:46 -0500 Original-Received: from youngberry.canonical.com ([91.189.89.112]:59762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kxCuk-0004qh-NU for 45655@debbugs.gnu.org; Wed, 06 Jan 2021 12:48:07 -0500 Original-Received: from mail-yb1-f198.google.com ([209.85.219.198]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kxCue-0002bA-WD for 45655@debbugs.gnu.org; Wed, 06 Jan 2021 17:48:01 +0000 Original-Received: by mail-yb1-f198.google.com with SMTP id a206so5372290ybg.0 for <45655@debbugs.gnu.org>; Wed, 06 Jan 2021 09:48:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=s1D1KmLIDehidf4j9tgla/Lzr3xTliNHpHl0zvP3MnY=; b=LxFclto2D/7sx4263E/dIYCld8b5fwBF2b75tdBBKBUDZO4Zm7S8y9MxCjpEkLmTrY P6GQ/h/zNQ+NCLAHDdctQz52+Fe5v1Mn2rBh58QwFofGKBwKbEewSrowNKYu1Geqg5RZ h5w9UP5O9zeKuvmozmJJmnGT/JcgpaQyo63iBjpwzaF4t0FHYP55Hiy5BFQivyg/g0lI Wt42ZioNTSaad9soelEIBA45/2gAlo3dxTY2ZIGpGgef4jLOovANAyJxyRUVFJA5JbVz Jm0E2BemFD2Mf6R5uSJF6UkdHKzTnJHoaB/YLsU2GftOKrC5b1j5V/d5Mt3SEv2Hm6+l K51A== X-Gm-Message-State: AOAM530vCyOt78iyntMAA5TiQwPBC8Xbs59Ou4/bxpEWSHTaLubwrZHw s3qYpiSyALrY+nt7ROZ2btiSPycgUiNnP1fUbOy2HAkWeKFtFoahCo69+OGTkCKc5R9f8oz9lEY D7RZYpNJeogO/Po6pvKji2Rzj44UPzrKv7ysXY2qJd+iihB0O X-Received: by 2002:a25:6853:: with SMTP id d80mr7200110ybc.47.1609955280066; Wed, 06 Jan 2021 09:48:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLIsKOsrFQH1MV3lcbkFXFV+zTxCNr8SKttYrBYMnEkBigoQxPPVnjJ3FZ4eaSA/VRBWpwfsSy23Tf5JrVyvA= X-Received: by 2002:a25:6853:: with SMTP id d80mr7200079ybc.47.1609955279774; Wed, 06 Jan 2021 09:47:59 -0800 (PST) In-Reply-To: <5kczyim26n.fsf@fencepost.gnu.org> X-Mailman-Approved-At: Wed, 06 Jan 2021 12:55:44 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:197435 Archived-At: Hi Glenn, Thanks for the quick response. On Wed, Jan 6, 2021 at 5:59 PM Glenn Morris wrote: > > Balint Reczey wrote: > > > Python 2 reached EOL about a year ago thus the 'python' command may be > > missing on some systems. 'python3' is the standard way of invoking the > > Python 3 interpreter, thus Emacs would have a better chance trying > > that. > > > > The attached patch is already carried in Ubuntu. > > Thanks for the report. > > > --- a/lisp/ldefs-boot.el > > +++ b/lisp/ldefs-boot.el > > @@ -26539,7 +26539,7 @@ > > > > (add-to-list 'interpreter-mode-alist (cons (purecopy "python[0-9.]*") 'python-mode)) > > > > -(autoload 'run-python "python" "\ > > +(autoload 'run-python "python3" "\ > > This bit is wrong. Firstly, ldefs-boot is a generated file, and > secondly, unless Ubuntu is distributing a python3.el, it would just > break the autoload. > > > --- a/lisp/progmodes/python.el > > +++ b/lisp/progmodes/python.el > > @@ -1952,7 +1952,7 @@ > > :group 'python > > :safe 'stringp) > > > > -(defcustom python-shell-interpreter "python" > > +(defcustom python-shell-interpreter "python3" > > (if (executable-find "python3") "python3" "python") > > is probably how Emacs would normally handle this kind of thing. > Or if defaulting to python3 is better (I guess it is): > > (cond ((executable-find "python3") "python3") > ((executable-find "python") "python") > (t "python3")) Indeed, that would be better for very old systems. Could you please land the proper fix or you would like me to rework mine? Thanks, Balint -- Balint Reczey Ubuntu & Debian Developer