mirror of
https://github.com/python/cpython.git
synced 2025-10-23 23:22:11 +00:00
Updated lagging version#. Also added some comments about how quote()
and quote_plus() can be optimized tenfold.
This commit is contained in:
parent
db23d3dbf7
commit
0dee4ee0f8
1 changed files with 3 additions and 1 deletions
|
|
@ -27,7 +27,7 @@ import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
__version__ = '1.10'
|
__version__ = '1.11' # XXX This version is not always updated :-(
|
||||||
|
|
||||||
MAXFTPCACHE = 10 # Trim the ftp cache beyond this size
|
MAXFTPCACHE = 10 # Trim the ftp cache beyond this size
|
||||||
|
|
||||||
|
|
@ -896,6 +896,7 @@ def unquote_plus(s):
|
||||||
|
|
||||||
always_safe = string.letters + string.digits + '_,.-'
|
always_safe = string.letters + string.digits + '_,.-'
|
||||||
def quote(s, safe = '/'):
|
def quote(s, safe = '/'):
|
||||||
|
# XXX Can speed this up an order of magnitude
|
||||||
safe = always_safe + safe
|
safe = always_safe + safe
|
||||||
res = list(s)
|
res = list(s)
|
||||||
for i in range(len(res)):
|
for i in range(len(res)):
|
||||||
|
|
@ -905,6 +906,7 @@ def quote(s, safe = '/'):
|
||||||
return string.joinfields(res, '')
|
return string.joinfields(res, '')
|
||||||
|
|
||||||
def quote_plus(s, safe = '/'):
|
def quote_plus(s, safe = '/'):
|
||||||
|
# XXX Can speed this up an order of magnitude
|
||||||
if ' ' in s:
|
if ' ' in s:
|
||||||
# replace ' ' with '+'
|
# replace ' ' with '+'
|
||||||
l = string.split(s, ' ')
|
l = string.split(s, ' ')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue