[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2021-03-19 Thread Eryk Sun


Eryk Sun  added the comment:

I'm no longer interested in solving the SIGINT event problem locally at the 
wait site. A common implementation of _Py_Sleep, _Py_WaitForSingleObject, and 
_Py_WaitForMultipleObjects is needed. _winapi.WaitForSingleObject would call 
_Py_WaitForSingleObject and automatically support the SIGINT event on the main 
thread.

--
resolution:  -> rejected
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



[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2016-09-16 Thread STINNER Victor

STINNER Victor added the comment:

> I decided to make it an error to pass an empty sequence

It makes sense since the original WaitForMultipleObjects() also requires at 
least one object:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms687025(v=vs.85).aspx

nCount [in]

The number of object handles in the array pointed to by lpHandles. The 
maximum number of object handles is MAXIMUM_WAIT_OBJECTS. This parameter cannot 
be zero.

--

___
Python tracker 

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



[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2016-09-16 Thread STINNER Victor

STINNER Victor added the comment:

Oh nice, you implemented the PEP 475 for _winapi.WaitForMultipleObjects()! I 
missed this function when implementing this PEP :-)

--
nosy: +haypo

___
Python tracker 

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



[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2016-09-16 Thread Eryk Sun

Eryk Sun added the comment:

Hopefully this is my last change until someone reviews this. I decided to make 
it an error to pass an empty sequence, which previously would implicitly wait 
on the SIGINT event. This way simplifies the code and prevents someone from 
accidentally waiting forever on SIGINT when it's ignored or doesn't raise an 
exception. There should always be at least 1 other handle in the wait list.

--
Added file: http://bugs.python.org/file44700/issue_28168_04.patch

___
Python tracker 

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



[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2016-09-16 Thread Eryk Sun

Changes by Eryk Sun :


Added file: http://bugs.python.org/file44698/issue_28168_03.patch

___
Python tracker 

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



[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2016-09-16 Thread Eryk Sun

Changes by Eryk Sun :


Removed file: http://bugs.python.org/file44673/issue_28168_01.patch

___
Python tracker 

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



[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2016-09-16 Thread Eryk Sun

Changes by Eryk Sun :


Removed file: http://bugs.python.org/file44674/issue_28168_02.patch

___
Python tracker 

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



[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2016-09-15 Thread Eryk Sun

Changes by Eryk Sun :


Added file: http://bugs.python.org/file44674/issue_28168_02.patch

___
Python tracker 

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



[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2016-09-15 Thread Eryk Sun

Eryk Sun added the comment:

This patch makes the trivial change to the Popen.wait() method and also 
modifies _winapi.WaitForMultipleObjects to restart the wait if SIGINT is 
ignored or the handler didn't raise an exception.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file44673/issue_28168_01.patch

___
Python tracker 

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



[issue28168] Use _winapi.WaitForMultipleObjects in Popen.wait()

2016-09-15 Thread Eryk Sun

New submission from Eryk Sun:

On Unix, waiting on an instance of subprocess.Popen in the main thread is 
interruptible by Ctrl+C. On Windows, it currently calls 
_winapi.WaitForSingleObject, which isn't interruptible. It should instead call 
_winapi.WaitForMultipleObjects, which automatically adds the SIGINT event 
object from _PyOS_SigintEvent() when called from the main thread.

--
components: Library (Lib), Windows
messages: 276544
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Use _winapi.WaitForMultipleObjects in Popen.wait()
type: enhancement
versions: Python 3.6, Python 3.7

___
Python tracker 

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