I am working on a script which uses subprocess and multiprocessing modules, the problem is that when i try to kill a process it said that WindowsError Access is Denied
Here is the problem in detail
def function1(file, childConn):
some statements
def fuction():
process1 = subprocess.Popen(process1_path, 0, None, None, None)
process2 = subprocess.Popen(process2_path , 0, None, None, None) #don't want to kill this process, will be terminated at the end of script
parentConnection, childConnection = Pipe()
p = Process(target = function1, args = (file, childConnection))
p.start()
parentConnection.recv()
p.join()
p.terminate()
process1.kill() <-- here is problem, it said that [WindowsError, Error 5, Access is Denied]
Can anyone help me in this matter?
Regards,