I'm trying to figure out what the error is to this line:
The error reads:
struct.error: the argument for 's' must be a bytes object
struct is a module that was imported.
The line highlighted by the error shows the second line. Are they talking about the "s" that was added to the other symbols, and why would it need to be a byte object?
This apparently has something to do with going from python 2 to python
- I tried converting binary format with bytes(binary_format,'utf-8') but it didn't work.
I tried this:
binary_format= bytes("<",'utf-8')+ bytes(str(name_length),'utf-8')+ bytes("s",'utf-8')
but I still get the same error.
Found it. It was the self.name that needed to be converted to bytes, or maybe all of them. Anyway, it works.