Ticket #2059 enhancement closed wontfix

Opened 7 years ago

Last modified 4 years ago

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

test_xmlrpc_unicode.py Download (0.8 KB) - added by yang 7 years ago.

Change History

Changed 7 years ago by yang

1

Changed 7 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.

2

Changed 5 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.

3

Changed 4 years ago by exarkun

  • status changed from new to closed
  • resolution set to wontfix

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.

4

Changed 2 years ago by <automation>

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