Terminate subprocess in Windows, access denied

前端 未结 3 848
萌比男神i
萌比男神i 2020-12-18 00:36

-

import time
import subprocess
from os.path import expanduser

chrome_path = expanduser(\'~\\Local Settings\\Application Data\\Google\\Chrome\\Application\\         


        
3条回答
  •  天命终不由人
    2020-12-18 00:46

    I don't know about Windows, but have noticed on Linux that Google Chrome "protects" itself from operating system control signals in a way that few programs do:

    $ ps -lp 2345
    F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
    4 S  1000  2345     1  0  80   0 - 17699 skb_re ?        00:00:00 chrome
    $ kill -TERM 2345
    $ kill -HUP 2345
    $ kill -SEGV 2345
    $ ps -lp 2345
    F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
    4 S  1000  2345     1  0  80   0 - 17699 skb_re ?        00:00:00 chrome
    

    I suspect this may be the root cause of your troubles. Incidentally, I'm posting this note from process 2345.

提交回复
热议问题