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 exarkun
Recipients JPosthuma, benjamin.peterson, djarb, exarkun, giampaolo.rodola, intgr, janssen, josiah.carlson, josiahcarlson, r.david.murray
Date 2009-07-13.15:33:20
SpamBayes Score 8.6042284e-15
Marked as misclassified No
Message-id <1247499203.27.0.314005382859.issue1563@psf.upfronthosting.co.za>
In-reply-to
Content
> It's not 'that' clear you should only work with bytes on a socket. 

It's pretty clear to me. :)  That's what sockets can deal with - bytes.
 If you want to transfer something other than bytes via a socket, then
you need to convert it to bytes.  In the case of unicode, there are many
different choices which can be made for how to do this conversion. 
asyncore cannot know what the correct choice is in any particular
situation, so it shouldn't try to make it.

The attached patch forces the application to make this choice,
fortunately.  However, since push_str is only one line, I'm not sure
what the attraction is.  Why is push_str(foo, bar) preferable to
push(foo.encode(bar))?

> Maybe it's possible to do a default byte conversion when the user is
working with strings.

This definitely isn't reasonable and should not be done.  It's also not
what the last proposed patch does, so it doesn't seem to the direction
the other interested parties have been working in.
History
Date User Action Args
2009-07-13 15:33:24exarkunsetrecipients: + exarkun, josiahcarlson, janssen, giampaolo.rodola, djarb, josiah.carlson, benjamin.peterson, r.david.murray, intgr, JPosthuma
2009-07-13 15:33:23exarkunsetmessageid: <1247499203.27.0.314005382859.issue1563@psf.upfronthosting.co.za>
2009-07-13 15:33:21exarkunlinkissue1563 messages
2009-07-13 15:33:20exarkuncreate