You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i'm using it with django, and an error occurred while I was running the program:bytes has no attribute encode 。so i changed the code of client.py at line 122.
before:
self.client.sendall(data.encode())
after:
if isinstance(data, bytes): self.client.sendall(data) elif isinstance(data, str): self.client.sendall(data.encode())
and then the program runs well.
i hope this issue will help
The text was updated successfully, but these errors were encountered:
I kind of wanted to keep the interface streamlined for send() and receive() to be handling strings. The conversion can be done from the caller (i.e. convert the data to str before calling client.send()) which adds a little bit of overhead of course.
The other solution would be for send to accept bytes and str. I have done a quick benchmarking on the overhead incurred on each instruction (assuming the baseline is passing data: str):
thanks for your project!
i'm using it with django, and an error occurred while I was running the program:bytes has no attribute encode 。so i changed the code of client.py at line 122.
before:
self.client.sendall(data.encode())
after:
if isinstance(data, bytes): self.client.sendall(data) elif isinstance(data, str): self.client.sendall(data.encode())
and then the program runs well.
i hope this issue will help
The text was updated successfully, but these errors were encountered: