unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#54860: 28.1; Problem with run-python
@ 2022-04-11 16:54 Robert Thorpe
  2022-04-11 17:29 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Thorpe @ 2022-04-11 16:54 UTC (permalink / raw)
  To: 54860


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 also get a warnings buffer telling me that the python prompts cannot
be detected.

In the Microsoft "Manage App Execution Aliases" I have turned off all
python related aliases.

The python shell works fine from a Windows cmd shell.

(I am sending this from Emacs 27.2 on Arch but I have copied over the
debug text blocks below from the machine with the problem).

BR,
Robert Thorpe



In GNU Emacs 28.1 (build 52, x86_64-w64-mingw32)
 of 2022-04-04 built on AVALON
Repository revision: 5a223c7f2ef4c31abbd46367b6ea83cd19d30aa7
Repository branch: heads/emacs-28.1
Windowing system distributor 'Microsoft Corp.', version 10.0.19042
System Description: Microsoft Windows 10 Enterprise (v10.0.2009.19042.1586)

Configured using:
 'configure --without-dbus --with-native-compilation
 --without-compress-install CFLAGS=-O2'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
XPM ZLIB

(NATIVE_COMP present but libgccjit not available)

Important settings:
  value of $LANG: ENI
  locale-coding-system: cp1252

Major mode: Inferior Python

Minor modes in effect:
  compilation-shell-minor-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils compile text-property-search warnings
python tramp-sh tramp tramp-loaddefs trampver tramp-integration files-x
tramp-compat shell pcomplete parse-time iso8601 time-date format-spec
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map seq byte-opt gv bytecomp byte-compile
cconv comint ring cl-loaddefs cl-lib ansi-color iso-transl tooltip eldoc
paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode
mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 74179 7585)
 (symbols 48 8907 1)
 (strings 32 27995 1889)
 (string-bytes 1 962898)
 (vectors 16 17454)
 (vector-slots 8 249009 10766)
 (floats 8 43 224)
 (intervals 56 253 0)
 (buffers 992 14))





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#54860: 28.1; Problem with run-python
  2022-04-11 16:54 bug#54860: 28.1; Problem with run-python Robert Thorpe
@ 2022-04-11 17:29 ` Eli Zaretskii
  2022-04-14  1:36   ` Robert Thorpe
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2022-04-11 17:29 UTC (permalink / raw)
  To: Robert Thorpe; +Cc: 54860

> From: Robert Thorpe <rt@robertthorpeconsulting.com>
> 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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#54860: 28.1; Problem with run-python
  2022-04-11 17:29 ` Eli Zaretskii
@ 2022-04-14  1:36   ` Robert Thorpe
  2022-04-14  6:19     ` Eli Zaretskii
  2022-04-15  3:58     ` Richard Stallman
  0 siblings, 2 replies; 5+ messages in thread
From: Robert Thorpe @ 2022-04-14  1:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 54860

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 <eliz@gnu.org> writes:

>> From: Robert Thorpe <rt@robertthorpeconsulting.com>
>> 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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#54860: 28.1; Problem with run-python
  2022-04-14  1:36   ` Robert Thorpe
@ 2022-04-14  6:19     ` Eli Zaretskii
  2022-04-15  3:58     ` Richard Stallman
  1 sibling, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2022-04-14  6:19 UTC (permalink / raw)
  To: Robert Thorpe; +Cc: 54860-done

> From: Robert Thorpe <rt@robertthorpeconsulting.com>
> Cc: 54860@debbugs.gnu.org
> Date: Thu, 14 Apr 2022 02:36:18 +0100
> 
> 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.

Thanks.  I added an entry in etc/PROBLEMS about this, and I'm closing
this bug.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#54860: 28.1; Problem with run-python
  2022-04-14  1:36   ` Robert Thorpe
  2022-04-14  6:19     ` Eli Zaretskii
@ 2022-04-15  3:58     ` Richard Stallman
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Stallman @ 2022-04-15  3:58 UTC (permalink / raw)
  To: Robert Thorpe; +Cc: 54860

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > 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.

Should we put any advice about this in etc/PROBLEMS?

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)







^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-15  3:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11 16:54 bug#54860: 28.1; Problem with run-python Robert Thorpe
2022-04-11 17:29 ` Eli Zaretskii
2022-04-14  1:36   ` Robert Thorpe
2022-04-14  6:19     ` Eli Zaretskii
2022-04-15  3:58     ` Richard Stallman

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).