emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `interrupt-process` doesn't work for Python on Windows


From: Eli Zaretskii
Subject: Re: `interrupt-process` doesn't work for Python on Windows
Date: Thu, 10 Feb 2022 15:01:02 +0200

> Date: Wed, 09 Feb 2022 10:17:33 +0100
> From: Joost <joostkremers@fastmail.fm>
> 
> https://github.com/jdtsmith/python-mls/issues/8#issuecomment-1033120469
> 
> To quote the relevant section:
> 
> ====================
> Here is the issue: `interrupt-process` (and internal C function) does not 
> function correctly to interrupt Python on Windows emacs! While at the command 
> prompt, a simple `C-c` does correctly interrupt (and returns `Keyboard 
> Interrupt\n>>> ` promptly), `interrupt-process` does not, and leads to the 
> double-traceback you reported earlier, but _only after you send another 
> newline_. This is incorrect behavior, and seems to represent a bug in the way 
> Emacs sends interrupts on Windows, which differs from `C-c` in the command 
> prompt.
> 
> It's easy to verify the difference:
> 
> * `C-c` at `>>> ` python prompt in "Command Prompt": immediate 
> `KeyboardInterrupt` and prompt.
> * `C-c C-c` at `>>> ` python prompt in Emacs _Python_: no `KeyboardInterrupt`.
> 
> ====================
> 
> Should I file a bug report about this? Or is this something Emacs can do 
> nothing about?

As I responded there, Emacs on MS-Windows emulates SIGINT to a
sub-process by injecting an actual Ctrl-C character into the
sub-process's input stream.  But that might not do what you expect,
because Emacs on Windows communicates with sub-processes via pipes,
not via (pseudo)console devices, and thus Python could react to Ctrl-C
differently than it reacts when run from the console.

So at least at the moment, this doesn't look like an Emacs problem.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]