Ticket #226 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

[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

Changed 4 years ago by bbangert

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

Fixed in r7188.

Note: See TracTickets for help on using tickets.