forked from cemerick/nrepl-python-client
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Unicode support was added somewhat hastily. I pretty much just shoved a b
in front of all the strings, and switched StringIO for BytesIO.
- I'm not entirely sure that StringIO is even used anymore. The import may be removable
- For some reason, StringIO can be imported as either
from StringIO import StringIO
orfrom io import StringIO
, what are their differences? does something similar apply to BytesIO? - This code
nrepl-python-client/nrepl/bencode.py
Lines 106 to 109 in a97ba25
# x = x.encode("UTF-8") # TODO revisit encodings, this is surely not right. Python # (2.x, anyway) conflates bytes and strings, but 3.x does not... out.write(str(len(x.encode('utf-8'))).encode('utf-8')) - Getting the length of the string in bytes
- Turning that length into a utf-8 encoded string
There's probably more refactoring to look into, but this is what comes to mind.
Metadata
Metadata
Assignees
Labels
No labels