8000 Handle ValueError during socket device shutdown by jjlawren · Pull Request #65 · nutechsoftware/alarmdecoder · GitHub
[go: up one dir, main page]

Skip to content

Handle ValueError during socket device shutdown#65

Merged
ajschmidt8 merged 1 commit intonutechsoftware:masterfrom
jjlawren:handle_valueerror
Mar 9, 2025
Merged

Handle ValueError during socket device shutdown#65
ajschmidt8 merged 1 commit intonutechsoftware:masterfrom
jjlawren:handle_valueerror

Conversation

@jjlawren
Copy link
Contributor

When the socket is closed down unexpectedly a ValueError can be thrown while waiting for a message:

2022-02-05 13:49:03 ERROR (Thread-3) [root] Uncaught thread exception
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/srv/homeassistant/venv/lib/python3.9/site-packages/alarmdecoder/devices/base_device.py", line 148, in run
    self._device.read_line(timeout=self.READ_TIMEOUT)
  File "/srv/homeassistant/venv/lib/python3.9/site-packages/alarmdecoder/devices/socket_device.py", line 323, in read_line
    read_ready, _, _ = select.select([self._device], [], [], 0.5)
ValueError: file descriptor cannot be a negative integer (-1)

Fixes #64

Copy link
Contributor
@edrikk edrikk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajschmidt8
Given that you have commit access, I wanted to flag a few PRs/changes that I've been running cleanly for a couple of years. These changes will also enable updating/correcting the requirements.txt file.
I'll using this same "approve" comment across these items.

@ajschmidt8 ajschmidt8 merged commit f930b24 into nutechsoftware:master Mar 9, 2025
@jjlawren jjlawren deleted the handle_valueerror branch March 9, 2025 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValueError: file descriptor cannot be a negative integer (-1)

4 participants

0