Message378284
Hello,
I've just run into a related issue. I have a python script, which starts an another python script using subprocess.Popen(). The parent script gets pid of the child and monitors up its activity through a database by this pid. The child script updates its activity in the database using the pid it gotten from os.getpid()
Both scripts live in a virtual environment.
It worked fine in Python 3.5 and stopped working after migration to Python 3.8.
My base Python location: D:\Python\Python38\pythonw.exe
Virtual Environment: D:\test\venv\Scripts\pythonw.exe
I have realized, that when I run the following from a command prompt:
D:\test\venv\Scripts\pythonw.exe test.py
2 processes with the different PIDs are created:
PID: 97040
Parent PID: 12004 (cmd.exe)
Command Line: D:\test\venv\Scripts\pythonw.exe test.py
PID: 85548
Parent PID: 97040 (pythonw.exe)
Command Line: D:\Python\Python38\pythonw.exe test.py
It is definitely a regression, and will potentially break a lot of applications expecting a child Python process to be a direct descendant of its parent.
Also it is a waste of system resources |
|
Date |
User |
Action |
Args |
2020-10-08 19:34:11 | nsmcan | set | recipients:
+ nsmcan, paul.moore, eric.smith, tim.golden, Jurko.Gospodnetić, zach.ware, eryksun, steve.dower, uranusjr, Benedek Rácz |
2020-10-08 19:34:11 | nsmcan | set | messageid: <1602185651.2.0.0253021629311.issue38905@roundup.psfhosted.org> |
2020-10-08 19:34:11 | nsmcan | link | issue38905 messages |
2020-10-08 19:34:11 | nsmcan | create | |
|