python3.9's json.loads remove encoding argument. https://docs.python.org/3/library/json.html#json.loads
According to python doc, json.loads assumes input is UTF-8, UTF-16 or UTF-32. So encoding is unnecessary even before 3.9.
UDP is not stable. In my case, there are always timeouts before first data arrived. I use a MSG_PEEK to ensure it's ready.
Two commits:
python3.9's
json.loads
removeencoding
argument. https://docs.python.org/3/library/json.html#json.loads According to python doc,json.loads
assumes input is UTF-8, UTF-16 or UTF-32. So encoding is unnecessary even before 3.9.UDP is not stable. In my case, there are always timeouts before first data arrived. I use a
MSG_PEEK
to ensure it's ready.