[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-05-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: Researching 'nested mainloop': the one we are concerned with is in pyshell.PyShell.readline, currently line 1078. self.top.mainloop() # nested mainloop() This was in David Scherer's 'Initial Revision' of 2000 Aug 14 without the comment. It has

[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-05-26 Thread Tal Einat
Tal Einat added the comment: Can someone talk about the reasoning behind the nested Tk mainloop? I haven't managed to find anything useful in code comments and such. Guido? -- ___ Python tracker ___

[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-05-26 Thread Tal Einat
Tal Einat added the comment: This seems to be at least partly intentional: When waiting for user input, IDLE starts a nested Tk mainloop (!), which is stopped by the end-of-line handler. It seems to me that this is what is causing displaying other outputs to be delayed. --

[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-02-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: I found a stackoverflow question (and my then answer) about the same issue: https://stackoverflow.com/questions/50108354/python-idle-running-code-differently-than-other-ides Although the code posted does not run, it gives a very legitimate use case ( is the s

[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-02-23 Thread Guido van Rossum
Guido van Rossum added the comment: It sounds like either an old implementation restriction or an old misguided attempt at keeping the IDLE console clean. I’m with Tal, let’s fix it and make it more like regular Python. Thanks John for taking the time to report this so clearly. -- _

[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-02-23 Thread Tal Einat
Tal Einat added the comment: I tend to think that we should avoid discrepancies with a simple Python command-line shell by default, and in this case I am not convinced that there is a good reason for a divergence in behavior. I'd be happy to look into debugging this issue in the next few day

[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-02-23 Thread John Smith
John Smith added the comment: Interesting finding. Just some thoughs: I have to disagree on the "the experience with input() in IDLE is more useful and less confusing, especially to beginners" part. Here are some reasons: 1. If a beginner starts with threading and expect a concurrent execut

[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-02-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: Summary: With IDLE running normally, with 2 processes, "input('prompt')" in the main thread blocks execution of "print('whatever')" in a separate thread. (Verified on Windows with 3.9 and macOS with 3.8.) The user can respond to the prompt without being di

[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-02-22 Thread John Smith
John Smith added the comment: P.S. here (other computer but with same observed behavior) I have a 3.6 32bit as one can see from the output. -- ___ Python tracker ___

[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-02-22 Thread John Smith
Change by John Smith : Added file: https://bugs.python.org/file48901/IDLE_threading_issue_min_example1.py ___ Python tracker ___ ___ Python

[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-02-22 Thread John Smith
John Smith added the comment: py -m idlelib -n path output: Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. No Subprocess WARNING: Running IDLE without a Subprocess is depreca

[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-02-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: If I understand, input() in one thread blocks print() in another thread. This sound like a new issue for this tracker, and possibly a bug in IDLE's implementation of std streams through a socket, but I need to see your code. Please try attaching it again.

[issue39724] IDLE threading + stdout/stdin observed blocking behavior

2020-02-22 Thread John Smith
New submission from John Smith : preamble: I am aware that I am not the first to encounter this issue but neither I could identify a preexisting ticket which fully matches nor is the commonly recommended "solution" (stay away from IDLE) satisfying. environment: win10, python 3.7 (tested with