Opened 12 years ago

Closed 9 years ago

#2059 enhancement closed wontfix (wontfix)

Can't pass unicode URL to xmlrpc.Proxy

Reported by: yang Owned by:
Priority: normal Milestone:
Component: web Keywords: unicode, xmlrpc
Cc: Branch:


Passing a unicode URL into twisted.xmlrpc.Proxy() raises "TypeError: Data must not be unicode" from twisted.internet.abstract.FileDescriptor.write() (e.g. when later calling Proxy.callRemote()).

Attached is a simple test case. (For some reason, this only works sometimes; other times, it hangs for a while and either succeeds or times out.)

Attachments (1) (832 bytes) - added by yang 12 years ago.

Download all attachments as: .zip

Change History (5)

Changed 12 years ago by yang

Attachment: added

comment:1 Changed 12 years ago by therve

What's the use case of this ? Do you really have URL with unicode data ? AFAIK URL is a subset of ascii. The problem is not with xmlrpc, but with every URL in Twisted.

comment:2 Changed 10 years ago by Jean-Paul Calderone

The apparent non-determinism is probably due to the behavior of urlparse, which sometimes returns the same type as it is passed, sometimes not, depending on whether it matches the type (instead of just the value) of a previously cached URL.

comment:3 Changed 9 years ago by Jean-Paul Calderone

Resolution: wontfix
Status: newclosed

The url parameter to Proxy.__init__ is documented to be of type str (or None). It is typical in Twisted for str to work in places where unicode does not. You just have to be careful about what you pass in here.

comment:4 Changed 7 years ago by <automation>

Owner: jknight deleted
Note: See TracTickets for help on using tickets.