This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author loewis
Recipients arjennienhuis, benjamin.peterson, eric.smith, loewis, vstinner
Date 2009-07-11.16:47:34
SpamBayes Score 6.445626e-10
Marked as misclassified No
Message-id <4A58C224.3090307@v.loewis.de>
In-reply-to <11ddbd200907110928r72828d3bxb6a01cdefc56be18@mail.gmail.com>
Content
> 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?
History
Date User Action Args
2009-07-11 16:47:35loewissetrecipients: + loewis, vstinner, eric.smith, benjamin.peterson, arjennienhuis
2009-07-11 16:47:34loewislinkissue3982 messages
2009-07-11 16:47:34loewiscreate