It seems bad practice for urllib methods to demand a str instance and they should demand a unicode instance. By demanding a str instance the default behavior is too demanding, for the web space it is being used, for the English language. We would want Python to extend beyond English when it uses urllib Currently I am encoding the unicode passed with 'utf-8' and that works.
I suspect you want to be using Python3, then. Although it is nowhere near as simple as that...even with Python3 you still sometimes have to deal with the fact that the wire protocol is bytes.
Nevermind. I had to download the source to see that it encodes to 'utf-8', or a passed encoding method, in the methods that are causing problems in 2.6.5.
Well, most of the point of Python3 is that the string type *is* unicode, which is what I meant by saying that you probably wanted Python3 in order to solve your concern :) There are still a few bugs to work out in the wire-protocol/unicode interface in Python3, but it is a *lot* cleaner than it was in Python2.
History
Date
User
Action
Args
2022-04-11 14:57:24
admin
set
github: 57669
2011-11-26 19:50:00
r.david.murray
set
messages: +
2011-11-23 04:36:04
Tyler.Starke
set
messages: +
2011-11-23 02:13:44
Tyler.Starke
set
messages: +
2011-11-23 01:48:37
r.david.murray
set
status: open -> closednosy: + r.david.murraymessages: + resolution: out of date