[Python-checkins] python/dist/src/Lib urllib.py, 1.165.2.2, 1.165.2.3

rhettinger@users.sourceforge.net rhettinger at users.sourceforge.net
Sat Oct 15 18:45:00 CEST 2005


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28019/Lib

Modified Files:
      Tag: release24-maint
	urllib.py 
Log Message:
Teach unquote() to handle unicode inputs

Index: urllib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/urllib.py,v
retrieving revision 1.165.2.2
retrieving revision 1.165.2.3
diff -u -d -r1.165.2.2 -r1.165.2.3
--- urllib.py	15 Sep 2005 05:28:25 -0000	1.165.2.2
+++ urllib.py	15 Oct 2005 16:44:57 -0000	1.165.2.3
@@ -1061,6 +1061,8 @@
             res[i] = _hextochr[item[:2]] + item[2:]
         except KeyError:
             res[i] = '%' + item
+        except UnicodeDecodeError:
+            res[i] = unichr(int(item[:2], 16)) + item[2:]
     return "".join(res)
 
 def unquote_plus(s):



More information about the Python-checkins mailing list