domschl/python-fhem

Exception in _event_worker_thread

party-pansen opened this issue · 3 comments

Hi,
I am using the Fhem EventQueue to catch all events in python. Sometimes (after hours and thousands of successfully tracked events) I get the following exception and my program stops:

Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.7/dist-packages/fhem/__init__.py", line 765, in _event_worker_thread dt = datetime.datetime(int(dd[0]), int(dd[1]), ValueError: invalid literal for int() with base 10: 'Das'

I think it should be easy to fix by some try/except… ?

I am wondering that I am the first who is experiencing this problem…

Best regards
party-pansen

Haven't seen this one before, but you're right, an exception handler should do the job.
I am preparing a fix for this.

long/medium term it would be probably better to have an alternative for socket connections for the event-queue.

python-fhem 0.6.3 is now published and should fix that datetime parsing exception. Thanks for the clear bug-report.

Thank you very much for this very fast fix!