akuker / SuperUPS

Other
6 stars 0 forks source link

TypeError: expected str, bytes or os.PathLike object, not tuple thrown on automated shutdown from upsdaemon.py #9

Closed stinkerton18 closed 2 years ago

stinkerton18 commented 2 years ago

On an automated shutdown, the upsdaemon.py script threw the following exception:

TypeError: expected str, bytes or os.PathLike object, not tuple
2022-09-07 16:36:01,564 - upsdaemon - WARNING - State has transitioned to States.STATE_POW>
2022-09-07 16:36:01,565 - upsdaemon - WARNING - Commanding a Shutdown
Traceback (most recent call last):
  File "/usr/bin/upsdaemon.py", line 76, in monitor
    os.system(SHUTDOWN_COMMAND)
stinkerton18 commented 2 years ago

This was found after updating from Pull #8

stinkerton18 commented 2 years ago

I did an in-place patch by changing line 76 from: os.system(SHUTDOWN_COMMAND) to: os.system("shutdown -h now")

Tested, working as expected. I'm assuming SHUTDOWN_COMMAND was intended to be a variable.

stinkerton18 commented 2 years ago

Closing as this isn't reproducible anymore with the latest main branch.