Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Process.terminate() may raise AccessDenied if process already died #1099

Closed
giampaolo opened this issue May 30, 2017 · 0 comments
Closed

Comments

@giampaolo
Copy link
Owner

This is something which also used to affect the subprocess module:
http://bugs.python.org/issue14252

Appveyor failure:
https://ci.appveyor.com/project/giampaolo/psutil/build/job/36xyueo57wdc17bm

======================================================================
ERROR: psutil.tests.test_process.TestProcess.test_cwd
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\projects\psutil\psutil\tests\test_process.py", line 84, in tearDown
    reap_children()
  File "c:\projects\psutil\psutil\tests\__init__.py", line 446, in reap_children
    p.terminate()
  File "c:\projects\psutil\psutil\__init__.py", line 354, in wrapper
    return fun(self, *args, **kwargs)
  File "c:\projects\psutil\psutil\__init__.py", line 1311, in terminate
    self._proc.kill()
  File "c:\projects\psutil\psutil\_pswindows.py", line 635, in wrapper
    raise AccessDenied(self.pid, self._name)
AccessDenied: psutil.AccessDenied (pid=1388)
======================================================================
ERROR: psutil.tests.test_process.TestProcess.test_name
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\projects\psutil\psutil\tests\test_process.py", line 84, in tearDown
    reap_children()
  File "c:\projects\psutil\psutil\tests\__init__.py", line 446, in reap_children
    p.terminate()
  File "c:\projects\psutil\psutil\__init__.py", line 354, in wrapper
    return fun(self, *args, **kwargs)
  File "c:\projects\psutil\psutil\__init__.py", line 1311, in terminate
    self._proc.kill()
  File "c:\projects\psutil\psutil\_pswindows.py", line 635, in wrapper
    raise AccessDenied(self.pid, self._name)
AccessDenied: psutil.AccessDenied (pid=2008)
======================================================================
ERROR: psutil.tests.test_unicode.TestFSAPIsWithInvalidPath.test_proc_name
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\projects\psutil\psutil\tests\test_unicode.py", line 152, in tearDown
    reap_children()
  File "c:\projects\psutil\psutil\tests\__init__.py", line 446, in reap_children
    p.terminate()
  File "c:\projects\psutil\psutil\__init__.py", line 354, in wrapper
    return fun(self, *args, **kwargs)
  File "c:\projects\psutil\psutil\__init__.py", line 1311, in terminate
    self._proc.kill()
  File "c:\projects\psutil\psutil\_pswindows.py", line 635, in wrapper
    raise AccessDenied(self.pid, self._name)
AccessDenied: psutil.AccessDenied (pid=2848)
----------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant