3006.4, macOS system_profiler.applications throws an exception
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description
system_profiler.applications on macOS is throwing an exception. It appears that the method it calls
plistlib.readPlistFromBytes() was removed in python 3.10
Setup
salt 3006.4 on macOS 14.1 w m1
sh-3.2# /opt/salt/bin/python3 --version
Python 3.10.13
sh-3.2# salt-call grains.item saltversion
local:
----------
saltversion:
3006.4
execute
salt-call system_profiler.applications
- [x ] on-prem machine
- VM (Virtualbox, KVM, etc. please specify)
- VM running on a cloud service, please be explicit and add details
- container (Kubernetes, Docker, containerd, etc. please specify)
- or a combination, please be explicit
- jails if it is FreeBSD
- classic packaging
- [ x] onedir packaging
- used bootstrap to install
Steps to Reproduce the behavior
sh-3.2# salt-call system_profiler.applications
17:30:30 - ERROR - salt._logging.impl - An un-handled exception was caught by Salt's global exception handler:
AttributeError: module 'plistlib' has no attribute 'readPlistFromBytes'
Traceback (most recent call last):
File "/opt/salt/salt-call", line 23, in
sys.exit(salt_call())
File "/opt/salt/lib/python3.10/site-packages/salt/scripts.py", line 443, in salt_call
client.run()
File "/opt/salt/lib/python3.10/site-packages/salt/cli/call.py", line 50, in run
caller.run()
File "/opt/salt/lib/python3.10/site-packages/salt/cli/caller.py", line 95, in run
ret = self.call()
File "/opt/salt/lib/python3.10/site-packages/salt/cli/caller.py", line 202, in call
ret["return"] = self.minion.executors[fname](
File "/opt/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in call
ret = self.loader.run(run_func, *args, **kwargs)
File "/opt/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/opt/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1260, in _run_as
return _func_or_method(*args, **kwargs)
File "/opt/salt/lib/python3.10/site-packages/salt/executors/direct_call.py", line 10, in execute
return func(*args, **kwargs)
File "/opt/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in call
ret = self.loader.run(run_func, *args, **kwargs)
File "/opt/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/opt/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1260, in _run_as
return _func_or_method(*args, **kwargs)
File "/opt/salt/lib/python3.10/site-packages/salt/modules/system_profiler.py", line 119, in applications
apps = _call_system_profiler("SPApplicationsDataType")
File "/opt/salt/lib/python3.10/site-packages/salt/modules/system_profiler.py", line 47, in _call_system_profiler
plist = plistlib.readPlistFromBytes(sysprofresults)
AttributeError: module 'plistlib' has no attribute 'readPlistFromBytes' (impl.py->__global_logging_exception_handler:1069)
Traceback (most recent call last):
File "/opt/salt/salt-call", line 23, in
sys.exit(salt_call())
File "/opt/salt/lib/python3.10/site-packages/salt/scripts.py", line 443, in salt_call
client.run()
File "/opt/salt/lib/python3.10/site-packages/salt/cli/call.py", line 50, in run
caller.run()
File "/opt/salt/lib/python3.10/site-packages/salt/cli/caller.py", line 95, in run
ret = self.call()
File "/opt/salt/lib/python3.10/site-packages/salt/cli/caller.py", line 202, in call
ret["return"] = self.minion.executors[fname](
File "/opt/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in call
ret = self.loader.run(run_func, *args, **kwargs)
File "/opt/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/opt/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1260, in _run_as
return _func_or_method(*args, **kwargs)
File "/opt/salt/lib/python3.10/site-packages/salt/executors/direct_call.py", line 10, in execute
return func(*args, **kwargs)
File "/opt/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 159, in call
ret = self.loader.run(run_func, *args, **kwargs)
File "/opt/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1245, in run
return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
File "/opt/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1260, in _run_as
return _func_or_method(*args, **kwargs)
File "/opt/salt/lib/python3.10/site-packages/salt/modules/system_profiler.py", line 119, in applications
apps = _call_system_profiler("SPApplicationsDataType")
File "/opt/salt/lib/python3.10/site-packages/salt/modules/system_profiler.py", line 47, in _call_system_profiler
plist = plistlib.readPlistFromBytes(sysprofresults)
AttributeError: module 'plistlib' has no attribute 'readPlistFromBytes'
(Include debug logs if possible and relevant)
Expected behavior
No exception, command should return correctly.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.) sh-3.2# salt-call --versions-report Salt Version: Salt: 3006.4Python Version:
Python: 3.10.13 (main, Oct 4 2023, 21:57:46) [Clang 14.0.0 (clang-1400.0.29.202)]
Dependency Versions:
cffi: 1.14.6
cherrypy: 18.6.1
dateutil: 2.8.0
docker-py: Not Installed
gitdb: 4.0.5
gitpython: 3.1.37
Jinja2: 3.1.2
libgit2: Not Installed
looseversion: 1.0.2
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.2
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 22.0
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.9.8
pygit2: Not Installed
python-gnupg: 0.4.8
PyYAML: 6.0.1
PyZMQ: 23.2.0
relenv: 0.13.12
smmap: 3.0.2
timelib: 0.2.4
Tornado: 4.5.3
ZMQ: 4.3.4
System Versions:
dist: darwin 23.1.0
locale: utf-8
machine: x86_64
release: 23.1.0
system: Darwin
version: 14.1 x86_64
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in salt/modules/system_profiler.py, especially _call_system_profiler and the applications function shown in the traceback. Reproduce with salt-call system_profiler.applications on macOS with Python 3.10, then verify that the command returns application data without the plistlib AttributeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, python
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100