amdgpu-fan icon indicating copy to clipboard operation
amdgpu-fan copied to clipboard

sudo pip install amdgpu-fan old code

Open ZyxerZyxani opened this issue 2 years ago • 2 comments

The pip package/library when installed uses old code that has not changed the yaml.load(f) part to yaml.safe_load(f), thus all installs using new libraries will get error when trying to run sudo amdgpu-fan after sudo pip3 install amdgpu-fan.

yaml.load(f) expects another argument in newer version, and thus throws error.

Traceback (most recent call last):
  File "/usr/bin/amdgpu-fan", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/amdgpu_fan/controller.py", line 67, in main
    config = load_config(location)
  File "/usr/lib/python3.10/site-packages/amdgpu_fan/controller.py", line 44, in load_config
    return yaml.load(f)
TypeError: load() missing 1 required positional argument: 'Loader'

Changing that line to yaml.safe_load(f) made it work for me

ZyxerZyxani avatar Mar 01 '22 12:03 ZyxerZyxani

Not just installing the package fails, but you also cannot run amdgpu-fan on systems with an updated package. Tested this on openSUSE Tumbleweed 20220623. changing yaml.load(f) to yaml.safe_load(f) also fixed it for me.

akrenz avatar Jun 28 '22 08:06 akrenz

After solving the issue by changing yaml.load(f) to yaml.safe_load(f), the issue reappears.

MekayelAnik avatar Mar 20 '24 00:03 MekayelAnik