From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Thorpe Newsgroups: gmane.emacs.bugs Subject: bug#54860: 28.1; Problem with run-python Date: Thu, 14 Apr 2022 02:36:18 +0100 Message-ID: <878rs8tpil.fsf@robertthorpeconsulting.com> References: <87zgkr1rxb.fsf@robertthorpeconsulting.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3143"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54860@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 14 03:38:22 2022 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 1neoRB-0000fQ-Br for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Apr 2022 03:38:21 +0200 Original-Received: from localhost ([::1]:38840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1neoR9-0007O0-Sw for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 Apr 2022 21:38:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1neoQs-0007Ns-VO for bug-gnu-emacs@gnu.org; Wed, 13 Apr 2022 21:38:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60581) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1neoQs-000296-72 for bug-gnu-emacs@gnu.org; Wed, 13 Apr 2022 21:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1neoQs-0008TF-35 for bug-gnu-emacs@gnu.org; Wed, 13 Apr 2022 21:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Thorpe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Apr 2022 01:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54860 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 54860-submit@debbugs.gnu.org id=B54860.164990027332540 (code B ref 54860); Thu, 14 Apr 2022 01:38:02 +0000 Original-Received: (at 54860) by debbugs.gnu.org; 14 Apr 2022 01:37:53 +0000 Original-Received: from localhost ([127.0.0.1]:54476 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neoQj-0008Sm-84 for submit@debbugs.gnu.org; Wed, 13 Apr 2022 21:37:53 -0400 Original-Received: from outbound-smtp10.blacknight.com ([46.22.139.15]:36473) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neoQh-0008SV-Bw for 54860@debbugs.gnu.org; Wed, 13 Apr 2022 21:37:51 -0400 Original-Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp10.blacknight.com (Postfix) with ESMTPS id E78541C42E9 for <54860@debbugs.gnu.org>; Thu, 14 Apr 2022 02:37:44 +0100 (IST) Original-Received: (qmail 26560 invoked from network); 14 Apr 2022 01:37:44 -0000 Original-Received: from unknown (HELO rt-inspiron-3480) (rt@robertthorpeconsulting.com@[109.78.29.216]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 14 Apr 2022 01:37:44 -0000 In-Reply-To: <83a6cr5y10.fsf@gnu.org> (message from Eli Zaretskii on Mon, 11 Apr 2022 20:29:31 +0300) 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:229850 Archived-At: I found the problem. It's not Emacs so you can close the bug. It was Microsofts' "App Execution Aliases" system. When I installed Python it seems to have been activated. I thought I could change the settings in "Manage App Execution Aliases" then repeatedly retry M-x run-python in the same Emacs. It doesn't work like that though. Emacs creates the path to python executable in a defcustom when python.el is started. At that time it captures the app execution alias and stores it. So, once python.el has started changing the aliases has no effect. Turning off all the app execution aliases and restarting Emacs solved it. I think the reason that 27.2 had worked was just that the instance of Emacs had started before I installed Python 3.9. So, the path to the python executable had not been interferred with. BR, Robert Thorpe Eli Zaretskii writes: >> From: Robert Thorpe >> Date: Mon, 11 Apr 2022 17:54:56 +0100 >> >> >> I recently upgraded to Emacs 28.1 on Microsoft Windows. I'm having >> problems with Inferior Python mode. On Emacs 27.2 that mode works. >> However, it doesn't work on Emacs 28.1, not even from emacs -Q. >> >> Reproduction is easy, from emacs -Q do "M-x run-python" on a Windows 10 >> machine. >> >> The variable exec-path contains the path to the python interpreter >> ("C:/Program Files/Python39/"). Emacs is correctly picking up the >> components of exec-path from my PATH environmental variable. >> >> However, run-python gives the error: >> "Python was not found; run with arguments to install from the Microsoft >> Store, or disable this shortcut from Setting > Manage App Execution >> Aliases. >> >> Process Python exited abnormally with code 49" > > I cannot reproduce this here. Could it be that the spaces in > "Program Files" are somehow the culprit? (On my system Python is > installed in a directory without embedded blanks.) > > If nothing gives a clue, can you step with Edebug through run-python > and its subroutines, and see what command is invoked by Emacs and how > it fails? > > Thanks.