Ticket #226 (closed defect: fixed)
[PATCH] wsgilib.raw_interactive adds unicode string to environ
| Reported by: | max | Owned by: | ianb |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.5 |
| Component: | paste | Version: | svn-trunk |
| Severity: | normal | Keywords: | |
| Cc: |
Description
I was debugging why paste lint gives an error when I use paste.fixture.TestApp? and found that the problems is within wsgilib.raw_interactive. It calls urlsplit function which returns a unicode string which makes the lint to issue AssertionError? about PATH_INFO.
Here is a fix:
Index: paste/wsgilib.py
===================================================================
--- paste/wsgilib.py (revision 7187)
+++ paste/wsgilib.py (working copy)
@@ -304,6 +304,8 @@
if path:
(_, _, path_info, query, fragment) = urlsplit(str(path))
path_info = urllib.unquote(path_info)
+ # urlsplit returns unicode so coerce it back to str
+ path_info, query = str(path_info), str(query)
basic_environ['PATH_INFO'] = path_info
if query:
basic_environ['QUERY_STRING'] = query
Change History
Note: See
TracTickets for help on using
tickets.
