[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor
STINNER Victor added the comment: > bpo-41686: Move _Py_RestoreSignals() to signalmodule.c (GH-23353) Sorry, this change was for bpo-41713. -- ___ Python tracker ___

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor
STINNER Victor added the comment: New changeset 29aa624047f893b3b3194f00252b2156bbbf4f9b by Victor Stinner in branch 'master': bpo-41686: Move _Py_RestoreSignals() to signalmodule.c (GH-23353) https://github.com/python/cpython/commit/29aa624047f893b3b3194f00252b2156bbbf4f9b --

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +22246 pull_request: https://github.com/python/cpython/pull/23353 ___ Python tracker ___

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor
STINNER Victor added the comment: Ok, the issue should now be fixed in 3.8, 3.9 and master branches. Thanks for the bug report hafiz bilal. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor
STINNER Victor added the comment: New changeset a702bd4b921167e73f8fc987aa64ada571fdc3f8 by Victor Stinner in branch '3.8': bpo-41686: Always create the SIGINT event on Windows (GH-23344) (GH-23347) (GH-23349) https://github.com/python/cpython/commit/a702bd4b921167e73f8fc987aa64ada571fdc3f8

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +22242 pull_request: https://github.com/python/cpython/pull/23349 ___ Python tracker ___

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor
STINNER Victor added the comment: New changeset 05a5d697f4f097f37c5c1e2ed0e2338a33c3fb6a by Victor Stinner in branch '3.9': bpo-41686: Always create the SIGINT event on Windows (GH-23344) (GH-23347) https://github.com/python/cpython/commit/05a5d697f4f097f37c5c1e2ed0e2338a33c3fb6a

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor
STINNER Victor added the comment: New changeset cda23be092f4a72e4f335cf182f11e7bd7fd98eb by Victor Stinner in branch 'master': bpo-41686: Refactor signal_exec() (GH-23346) https://github.com/python/cpython/commit/cda23be092f4a72e4f335cf182f11e7bd7fd98eb --

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +22239 pull_request: https://github.com/python/cpython/pull/23347 ___ Python tracker ___

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +22238 pull_request: https://github.com/python/cpython/pull/23346 ___ Python tracker ___

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor
STINNER Victor added the comment: New changeset 0ae323b87f1bed64a7fa70f5a41a5800aca032cc by Victor Stinner in branch 'master': bpo-41686: Always create the SIGINT event on Windows (GH-23344) https://github.com/python/cpython/commit/0ae323b87f1bed64a7fa70f5a41a5800aca032cc --

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-11-17 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +22235 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23344 ___ Python tracker ___

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-09-02 Thread Steve Dower
Steve Dower added the comment: > Could sigint_event be relocated to a platform-dependent extension of > _PyRuntimeState that gets initialized and finalized independent of any module? This, or leaving it where it is and making sure it gets initialised (it really is about emulating certain

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-09-02 Thread Eryk Sun
Eryk Sun added the comment: > Maybe in the time module? The SIGINT event is also needed by PyOS_Readline, _io (builtin), _winapi (builtin), and _multiprocessing (pyd). Is the time module guaranteed to be imported in 3.x? It appears to get imported incidentally via _PyImportZip_Init

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-09-02 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg376231 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-09-02 Thread Eryk Sun
Eryk Sun added the comment: > Maybe in the time module? The SIGINT event is also needed by PyOS_Readline, _io (builtin), _winapi (builtin), and _multiprocessing (pyd). Is the time module guaranteed to be imported in 3.x? It appears to get imported incidentally via _PyImportZip_Init

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-09-02 Thread STINNER Victor
STINNER Victor added the comment: By the way, it would be nice to add error handling on: sigint_event = CreateEvent(NULL, TRUE, FALSE, FALSE); See also PR #22049. -- ___ Python tracker

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-09-02 Thread STINNER Victor
STINNER Victor added the comment: Py_InitializeEx() should be modified to always initialize sigint_event, even if install_sigs is equal to zero. Maybe the variable should be moved somewhere else. Maybe in the time module? -- ___ Python tracker

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-09-01 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-09-01 Thread Eryk Sun
Eryk Sun added the comment: The SIGINT event gets created when the _signal extension module is imported. Until then, _PyOS_SigintEvent() returns NULL. But currently all code that calls _PyOS_SigintEvent() assumes it returns a valid handle. This has to be fixed to support Py_InitializeEx(0).

[issue41686] C++ Embedded 'time.sleep()' is not working on Windows host due to 'Py_InitializeEx(0)'

2020-09-01 Thread hafiz bilal
New submission from hafiz bilal : Hi, time.sleep() function is not working on Windows host if I use C API Py_InitializeEx(0) function. Issue could be reproduce with following simple example. int main() { Py_InitializeEx(0); PyRun_SimpleString("import time \n"