Opened 8 years ago

Closed 6 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:
Author: Launchpad Bug:

Description

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)

test_xmlrpc_unicode.py (832 bytes) - added by yang 8 years ago.

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by yang

comment:1 Changed 8 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 6 years ago by exarkun

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 6 years ago by exarkun

  • Resolution set to wontfix
  • Status changed from new to closed

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 3 years ago by <automation>

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