Ticket #234 (closed defect: wontfix)

Opened 4 years ago

Last modified 2 years ago

paste.fixture.TestApp._gen_request Chokes on Unicode Parameters

Reported by: brendan Owned by: ianb
Priority: normal Milestone: 1.5
Component: paste Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

Try putting a unicode string with unicode characters into the params argument of a post to TestApp? - when it hits paste.fixture.TestApp?._gen_request Python will throw a UnicodeEncodeError? due to the use of urllib.urlencode on the parameters. As far as I know, this blocks easily testing unicode inputs to forms.

Change History

Changed 4 years ago by ianb

Well, strictly speaking all parameters must be str, as that's what a request is. So all the values must be encoded. I suppose TestApp? could encode the parameters itself, using whatever the declared "site" encoding is (default to utf8 probably, given during instantiation).

Changed 4 years ago by brendan

My thinking was just that the TestApp? should try to mimic an actual application as closely as possible. Since a user can send a post from a browser with unicode and not generate an error, it'd make sense if a developer could do the equivalent in testing. Your idea for TestApp? to encode to the site encoding would address this.

Changed 4 years ago by ianb

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

I'd like to deprecate paste.fixture.TestApp? in favor of the WebOb?-based WebTest? ( http://pythonpaste.org/webtest/)

Since you can get around this by encoding your own values, and fixing this would require digging into paste.fixture.TestApp? more than I'd like, I'm going to mark this wontfix.

Changed 2 years ago by Trac123

Unicode characters into the params argument of a post to TestApp?? - when it hits paste.fixture.TestApp??._gen_request Python will throw a  get the g2m3 codec due to the use of urllib.urlencode on the parameters. As far as I know, this blocks easily testing unicode inputs to forms.

Note: See TracTickets for help on using tickets.