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

[OpenIndiana] 'set' object has no attribute 'get' #2199

Closed
mtelka opened this issue Feb 5, 2023 · 2 comments
Closed

[OpenIndiana] 'set' object has no attribute 'get' #2199

mtelka opened this issue Feb 5, 2023 · 2 comments

Comments

@mtelka
Copy link
Contributor

mtelka commented Feb 5, 2023

Summary

  • OS: OpenIndiana
  • Architecture: 64bit
  • Psutil version: 5.9.4
  • Python version: Python 3.7.16, Python 3.9.16
  • Type: tests

Description

___________________________ TestSystemAPIs.test_pids ___________________________

self = <psutil.tests.test_posix.TestSystemAPIs testMethod=test_pids>

    @retry_on_failure()
    def test_pids(self):
        # Note: this test might fail if the OS is starting/killing
        # other processes in the meantime
>       pids_ps = sorted(ps("pid"))

psutil/tests/test_posix.py:306:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

fmt = 'pid', pid = None

    def ps(fmt, pid=None):
        """
        Wrapper for calling the ps command with a little bit of cross-platform
        support for a narrow range of features.
        """

        cmd = ['ps']

        if LINUX:
            cmd.append('--no-headers')

        if pid is not None:
            cmd.extend(['-p', str(pid)])
        else:
            if SUNOS or AIX:
                cmd.append('-A')
            else:
                cmd.append('ax')

        if SUNOS:
            fmt_map = set(('command', 'comm', 'start', 'stime'))
>           fmt = fmt_map.get(fmt, fmt)
E           AttributeError: 'set' object has no attribute 'get'

psutil/tests/test_posix.py:67: AttributeError
@mtelka mtelka added the bug label Feb 5, 2023
@github-actions github-actions bot added the tests label Feb 5, 2023
@mtelka
Copy link
Contributor Author

mtelka commented Aug 11, 2023

It looks like the problematic code is aiming to do some kind of format specifier remap since there are no command and start format names in illumos implementation of ps. See the man page at https://illumos.org/man/1/ps
This is inherited from Solaris: https://docs.oracle.com/cd/E88353_01/html/E37839/ps-1.html

@mtelka
Copy link
Contributor Author

mtelka commented Aug 11, 2023

The problem seems to be already fixed via 12fe73d.

@mtelka mtelka closed this as completed Aug 11, 2023
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