From: Eli Zaretskii <eliz@gnu.org>
To: Robert Thorpe <rt@robertthorpeconsulting.com>
Cc: 55119@debbugs.gnu.org
Subject: bug#55119: 27.2; Inferior Python/ M-x run-python problem with Tk on Windows
Date: Tue, 26 Apr 2022 14:14:02 +0300 [thread overview]
Message-ID: <83a6c8m70l.fsf@gnu.org> (raw)
In-Reply-To: <87sfq0ebip.fsf@robertthorpeconsulting.com> (message from Robert Thorpe on Tue, 26 Apr 2022 05:03:58 +0100)
> From: Robert Thorpe <rt@robertthorpeconsulting.com>
> Date: Tue, 26 Apr 2022 05:03:58 +0100
>
> I have a problem with M-x run-python on Windows 10 enterprise.
>
> The python code I'm working on uses Tk. Unfortunately, after Tk is used
> the inferior python no longer responds to inputs. I see one more
> prompt, then nothing at all.
>
> Type the following into an inferior python process. Or alternatively,
> put it in a file and import it.
>
> import tkinter as tk
> from tkinter import ttk
> window = tk.Tk()
>
> This pops up a Tk window with nothing in it. It also gives another
> python prompt. But after that communication between Emacs and the
> inferior python process seems to be lost.
Unless there's someone here who uses this configuration on Windows,
knows the details, and can dig into the problem, you'll have to tell
more about what the above does, from the technical POV. It is likely
some snafu with I/O between Emacs and Python when it uses Tcl/Tk, but
what exactly and whether it's at all solvable, is anybody's guess at
this point. All I can tell you is that Emacs on Windows uses a
bidirectional pipe to communicate with subprocesses, so if the above
fiddles with standard I/O streams in some non-trivial ways, or assumes
it can separate input device from output device, or redirect them
separately to different places, or even that one or both of them are
or can be made unbuffered -- it will simply fail to work on Windows.
You have a single bidirectional pipe which is buffered by the OS, and
at least Python (or any other external program) will see that its
standard I/O is not connected to a console device, and will
(mis)behave accordingly.
The buffering issue you could perhaps deal with, by telling Python to
use unbuffered I/O. But I'm not even sure this is the root cause of
what you see.
That is all I can tell without more detail, sorry.
next prev parent reply other threads:[~2022-04-26 11:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-26 4:03 bug#55119: 27.2; Inferior Python/ M-x run-python problem with Tk on Windows Robert Thorpe
2022-04-26 11:14 ` Eli Zaretskii [this message]
2022-07-23 8:41 ` Lars Ingebrigtsen
2022-07-25 4:30 ` Robert Thorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83a6c8m70l.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=55119@debbugs.gnu.org \
--cc=rt@robertthorpeconsulting.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.