Skip to content
Advertisement

sending pickled data via UDP, unpickle fails with UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xff in position 0: ordinal not in range(128)

This is my code snippet that sends data over ethernet from one PC to another which is working fine.

JavaScript

At the receiver end, I am not able to decode it. It says:

JavaScript

This is the snippet at the receiver end

JavaScript

Advertisement

Answer

Why are you even pickling the data? You can send binary data via UDP anyway:

JavaScript

Then at the receiving end:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement