Jean-Paul Calderone <exar...@divmod.com> added the comment: > 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. ---------- nosy: +exarkun _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue1563> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com