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

Process.exe() on FreeBSD may raise OSError(ENOENT) #907

Closed
giampaolo opened this issue Oct 5, 2016 · 0 comments
Closed

Process.exe() on FreeBSD may raise OSError(ENOENT) #907

giampaolo opened this issue Oct 5, 2016 · 0 comments

Comments

@giampaolo
Copy link
Owner

======================================================================
FAIL: test_fetch_all (psutil.tests.test_process.TestFetchAllProcesses)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "psutil/tests/test_process.py", line 1605, in test_fetch_all
    self.fail(''.join(failures))
AssertionError:     
    ======================================================================
    FAIL: test_exe (proc=psutil.Process(pid=4018, name='screen'))
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "psutil/tests/test_process.py", line 1570, in test_fetch_all
        ret = attr(*args)
      File "psutil/__init__.py", line 605, in exe
        exe = self._proc.exe()
      File "psutil/_psbsd.py", line 413, in wrapper
        return fun(self, *args, **kwargs)
      File "psutil/_psbsd.py", line 461, in exe
        return cext.proc_exe(self.pid)
    OSError: [Errno 2] No such file or directory

The error originates from sysctl used with KERN_PROC_PATHNAME. Also procstat fails, although with a different error:

user@freebsd~/psutil$ sudo procstat -b 4108
procstat: sysctl(kern.proc): No such process
procstat: procstat_getprocs()

What we can do is return an empty string instead, since this is already allowed by exe() API.

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