Martin v. Löwis <[email protected]> added the comment:
> hex(10) returns '0xa' instead of 'a'.
Ah, right. So I would still use
'{0:x}'.format(100).encode("ascii")
rather than the format builtin format function. Actually, I would
probably use
('%x' % len(bytes)).encode("ascii")
> The point is that need to convert to ascii for each int that you send.
> You cannot just wrap the socket with an encoding. This makes porting
> difficult.
This I don't understand. What porting becomes more difficult?
>From 2.x to 3.x? Why do you have any .format calls in your code that you
want to port - .format was only added in 2.6, so if you want to support
2.x, you surely are not using .format, are you?
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue3982>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com