[issue38905] venv python reports wrong sys.executable in a subprocess on Windows

2021-03-22 Thread Assaf


Assaf  added the comment:

The fact that now there is a redirector process seems to me like a regression 
issue.
I have an application which Popen several processes and uses the Popen object 
in order to get the subprocesses pids and act upon this pids (i.e. looks for 
log files with associated pid).

Now this breaks because the subprocess pid is the one of the redirector and not 
the actual one.

This is similar to 'Ray' issue mentioned earlier.

--
nosy: +awaizman

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



[issue36295] Need to yield (sleep(0)) twice in asyncio

2019-03-14 Thread Assaf Dayan


New submission from Assaf Dayan :

In asyncio, 'await asyncio.sleep(0)' is used to relinquish control and check 
for finished awaitables before continuing. 
In my example, an awaitable returns but is only handled if 'await 
asyncio.sleep(0)' is called twice (adjacently) and only then the returned 
'await' statements are handled correctly.

The attached script generates tasks which do the following: compute for 0.8 
seconds; do an async op for 0.5 seconds; and compute some more for 0.2 seconds.
Before generating each new task, we relinquish control so that existing pending 
tasks will resume operation, if their 'await' statements returned.
We simulate a business-case in which we give precedence to already-processing 
tasks over new ones.

When running the attached script, Task 1 goes async at d=0.8 and should be 
ready by d=1.3 (asyncio.sleep(0.5)). Because Task 2 started at d=0.8 (when T1 
went async) it will relinquish control at d=1.6. By relinquishing control at 
d=1.6, Task 1 should resume, but it doesn't, unless asyncio.sleep(0) is called 
once more.
If asyncio.sleep(0) is not called again (as a fix), Task 1 will only resume at 
d=2.4, which is after Task 3 relinquished control.

--
files: async_yield.py
messages: 337950
nosy: Assaf Dayan
priority: normal
severity: normal
status: open
title: Need to yield (sleep(0)) twice in asyncio
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48207/async_yield.py

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