[Python-checkins] python/dist/src/Lib urllib.py,1.172,1.173

rhettinger@users.sourceforge.net rhettinger at users.sourceforge.net
Sat Sep 10 20:17:57 CEST 2005


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26841
Modified Files:
	urllib.py 
Log Message:
Corrected version of 1.170
Index: urllib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/urllib.py,v
retrieving revision 1.172
retrieving revision 1.173
diff -u -d -r1.172 -r1.173
--- urllib.py	10 Sep 2005 14:30:09 -0000	1.172
+++ urllib.py	10 Sep 2005 18:17:54 -0000	1.173
@@ -1110,12 +1110,9 @@
 def quote_plus(s, safe = ''):
 """Quote the query fragment of a URL; replacing ' ' with '+'"""
 if ' ' in s:
- l = s.split(' ')
- for i in range(len(l)):
- l[i] = quote(l[i], safe)
- return '+'.join(l)
- else:
- return quote(s, safe)
+ s = quote(s, safe + ' ')
+ return s.replace(' ', '+')
+ return quote(s, safe)
 
 def urlencode(query,doseq=0):
 """Encode a sequence of two-element tuples or dictionary into a URL query string.


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /