Paste number 36502: fixed quote patch

Paste number 36502: fixed quote patch
Pasted by: alec
When:2 years, 4 months ago
Share:Tweet this! | http://paste.lisp.org/+S5Y
Channel:#trac
Paste contents:
Raw Source | XML | Display As
Index: pyndexter/util.py
===================================================================
--- pyndexter/util.py	(revision 378)
+++ pyndexter/util.py	(working copy)
@@ -7,6 +7,7 @@
 #
 
 import re
+from StringIO import StringIO
 try:
     set = set
 except:
@@ -35,13 +36,16 @@
     def __init__(self, uri=None):
         if uri is not None:
             from cgi import parse_qs
+            from urllib import unquote_plus
 
             match = self._pattern.match(uri)
             if match is None:
                 raise ValueError('Invalid URI')
-            groups = match.groups()
-            groups = groups[0:5] + (parse_qs(groups[5] or ''),) + groups[6:]
-            groups = [group or '' for group in groups]
+            groups = [g or '' for g in match.groups()]
+            def uqc(gs):
+                return [unquote_plus(g) for g in gs]
+            groups = uqc(groups[0:5]) + [parse_qs(groups[5] or '')] + \
+                     uqc(groups[6:])
         else:
             groups = [''] * 7

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.