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

exe() on 'System' returns unhandled exception #528

Closed
mrjefftang opened this issue Aug 21, 2014 · 2 comments
Closed

exe() on 'System' returns unhandled exception #528

mrjefftang opened this issue Aug 21, 2014 · 2 comments
Labels

Comments

@mrjefftang
Copy link
Collaborator

Python: 3.4.1
psutil: HEAD as of 08/21/2014
OS: Windows XP 32-bit and 64-bit

psutil.Process(4).name() returns 'System'
psutil.Process(4).exe() throws an exception

>>> psutil.Process(4).exe()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "\psutil\psutil\__init__.py", line 533, in exe
    exe = self._proc.exe()
  File "\psutil\psutil\_pswindows.py", line 206, in wrapper
    return fun(self, *args, **kwargs)
  File "\psutil\psutil\_pswindows.py", line 248, in exe
    return _convert_raw_path(cext.proc_exe(self.pid))
OSError: [WinError 0] The operation completed successfully

>>> psutil.Process(4).as_dict()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "\psutil\psutil\__init__.py", line 414, in as_dict
    ret = attr()
  File "\psutil\psutil\__init__.py", line 533, in exe
    exe = self._proc.exe()
  File "\psutil\psutil\_pswindows.py", line 206, in wrapper
    return fun(self, *args, **kwargs)
  File "\psutil\psutil\_pswindows.py", line 248, in exe
    return _convert_raw_path(cext.proc_exe(self.pid))
FileNotFoundError: [WinError 18] There are no more files

@mrjefftang
Copy link
Collaborator Author

Under psutil 1.2.1 it correctly throws an AccessDenied

>>> psutil.Process(4).exe()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "psutil\_common.py", line 85, in __get__
    ret = self.func(instance)
  File "psutil\__init__.py", line 387, in exe
    return guess_it(fallback=err)
  File "psutil\__init__.py", line 380, in guess_it
    raise fallback
psutil._error.AccessDenied: (pid=4)

@giampaolo
Copy link
Owner

Closing this out as a duplicate of #529

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants