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

[SunOS] PID 0 raises FileNotFoundError #1642

Closed
giampaolo opened this issue Dec 18, 2019 · 0 comments
Closed

[SunOS] PID 0 raises FileNotFoundError #1642

giampaolo opened this issue Dec 18, 2019 · 0 comments

Comments

@giampaolo
Copy link
Owner

From:
#1638 (comment)

======================================================================
ERROR: psutil.tests.test_process.TestProcess.test_pid_0
----------------------------------------------------------------------
Traceback (most recent call last):
  File "<...>/site-packages/psutil/_common.py", line 342, in wrapper
    ret = self._cache[fun]
AttributeError: _cache

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<...>/site-packages/psutil/tests/test_process.py", line 1425, in test_pid_0
    self.assertRaises(psutil.NoSuchProcess, psutil.Process, 0)
  File "<...>/unittest/case.py", line 733, in assertRaises
    return context.handle('assertRaises', args, kwargs)
  File "<...>/unittest/case.py", line 178, in handle
    callable_obj(*args, **kwargs)
  File "<...>/site-packages/psutil/__init__.py", line 446, in __init__
    self._init(pid)
  File "<...>/site-packages/psutil/__init__.py", line 473, in _init
    self.create_time()
  File "<...>/site-packages/psutil/__init__.py", line 823, in create_time
    self._create_time = self._proc.create_time()
  File "<...>/site-packages/psutil/_pssunos.py", line 343, in wrapper
    return fun(self, *args, **kwargs)
  File "<...>/site-packages/psutil/_pssunos.py", line 436, in create_time
    return self._proc_basic_info()[proc_info_map['create_time']]
  File "<...>/site-packages/psutil/_pssunos.py", line 343, in wrapper
    return fun(self, *args, **kwargs)
  File "<...>/site-packages/psutil/_common.py", line 345, in wrapper
    return fun(self)
  File "<...>/site-packages/psutil/_pssunos.py", line 399, in _proc_basic_info
    ret = cext.proc_basic_info(self.pid, self._procfs_path)
FileNotFoundError: [Errno 2] No such file or directory: '/proc/0/psinfo'

Instead we should get AccessDenied.

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