mirror of https://github.com/OpenIPC/python-dvr
Browse Source
The `encoding` keyword argument to `json.loads` was deprecated in
Python 3.1 and removed in 3.9, so `AlarmServer.py` has been crashing on
the very first received packet under any modern Python install:
TypeError: JSONDecoder.__init__() got an unexpected keyword argument 'encoding'
Decode the bytes once and strip the framing tail (`\x00\n`) before
handing the string to `json.loads`. Verified with a self-test packet on
Python 3.13.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
pull/7/head
1 changed files with 1 additions and 1 deletions
Loading…
Reference in new issue