[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2019-07-23 Thread Steve Dower


Change by Steve Dower :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2019-07-17 Thread Zackery Spytz


Zackery Spytz  added the comment:

Can this issue be closed? PR 7978 was merged and backported.

--
nosy: +ZackerySpytz

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2018-06-28 Thread Steve Dower


Steve Dower  added the comment:


New changeset 9d92524c11def666a78ff57a9603a9ad6142418a by Steve Dower (Miss 
Islington (bot)) in branch '3.7':
bpo-31546: Fix input hook integration (GH-7978)
https://github.com/python/cpython/commit/9d92524c11def666a78ff57a9603a9ad6142418a


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2018-06-28 Thread miss-islington


miss-islington  added the comment:


New changeset 0ebd1bc94a941a5044e26de946c1100d652dfe46 by Miss Islington (bot) 
in branch '3.6':
bpo-31546: Fix input hook integration (GH-7978)
https://github.com/python/cpython/commit/0ebd1bc94a941a5044e26de946c1100d652dfe46


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2018-06-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7602

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2018-06-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7601

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2018-06-28 Thread Steve Dower


Steve Dower  added the comment:


New changeset 9b9d58f0d88b338eb8d2ae0da5cd91d60d1b0e39 by Steve Dower (Thomas A 
Caswell) in branch 'master':
bpo-31546: Fix input hook integration (GH-7978)
https://github.com/python/cpython/commit/9b9d58f0d88b338eb8d2ae0da5cd91d60d1b0e39


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2018-06-27 Thread Thomas Caswell


Change by Thomas Caswell :


--
keywords: +patch
pull_requests: +7589
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2017-11-04 Thread Steve Dower

Steve Dower  added the comment:

And yes, I think this is fine for 3.6.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2017-11-04 Thread Steve Dower

Steve Dower  added the comment:

The fix is simple, just need someone to do a PR. (I might get to it eventually, 
but I'm working on other things right now.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2017-10-23 Thread Lam Yuen Hei

Lam Yuen Hei  added the comment:

As the fix seems simple, any chance this bug can be fixed in next python 3.6 
maintenance release? It is the major roadblock for my application to upgrade to 
python 3.6. Thanks

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2017-09-21 Thread Steve Dower

Steve Dower added the comment:

(Belongs inside Parser/myreadline.c in the _PyOS_WindowsConsoleReadline 
function)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2017-09-21 Thread Steve Dower

Steve Dower added the comment:

You're right, we're missing this section of code:

if (PyOS_InputHook != NULL)
(void)(PyOS_InputHook)();

Since we just call it and ignore anything it does, it should be safe enough to 
add it immediately before the ReadConsoleW call (inside the loop).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2017-09-21 Thread Lam Yuen Hei

Lam Yuen Hei added the comment:

Attach python 3.6 call stack of the test script

--
Added file: https://bugs.python.org/file47162/py36_call_stack.png

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2017-09-21 Thread Lam Yuen Hei

Lam Yuen Hei added the comment:

Attach python 3.5 call stack of the test script

--
Added file: https://bugs.python.org/file47161/py35_call_stack.png

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2017-09-21 Thread Lam Yuen Hei

New submission from Lam Yuen Hei:

Since python 3.6, PyOS_InputHook is not called when waiting for IO in Windows.

This causes issues with GUI framework like tkinter that relys on PyOS_InputHook 
to handle user interaction.

I attached a test script. When running the script with python 3.5, the tkinter 
window will show up properly. But if you run the script with python 3.6, the 
tkinter window will be frozen. 

I believe the issue is introduced in commit 3929499. In commit 3929499, 
_PyOS_WindowsConsoleReadline is added as the new Windows implementation of 
PyOS_StdioReadline. Originally, PyOS_StdioReadline calls my_fgets to read 
input, and my_fgets will call PyOS_InputHook before the calling the real fgets. 
However, _PyOS_WindowsConsoleReadline calls ReadConsoleW instead of my_fgets to 
read input, and PyOS_InputHook is never called.

The bug is first reported in matplotlib.
https://github.com/matplotlib/matplotlib/issues/9206#issuecomment-331192016

--
components: Windows
files: test_tk.py
messages: 302701
nosy: paul.moore, steve.dower, tim.golden, yhlam, zach.ware
priority: normal
severity: normal
status: open
title: PyOS_InputHook is not called when waiting for input() in Windows
type: behavior
versions: Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47160/test_tk.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com