Esempio n. 1
0
def encode_path(*components):
    'Encode the path specified as a list of path components using URL encoding'
    return '/' + '/'.join(urlquote(x.encode('utf-8'), '') for x in components)
Esempio n. 2
0
 def quoted(x):
     if not isinstance(x, (str, bytes)):
         x = str(x)
     if isinstance(x, str):
         x = x.encode('utf-8')
     return urlquote(x, '')
Esempio n. 3
0
 def quoted(x):
     if not isinstance(x, (unicode_type, bytes)):
         x = unicode_type(x)
     if isinstance(x, unicode_type):
         x = x.encode('utf-8')
     return urlquote(x, '')
Esempio n. 4
0
def encode_path(*components):
    'Encode the path specified as a list of path components using URL encoding'
    return '/' + '/'.join(urlquote(x.encode('utf-8'), '') for x in components)
Esempio n. 5
0
 def quoted(x):
     if not isinstance(x, (unicode_type, bytes)):
         x = unicode_type(x)
     if isinstance(x, unicode_type):
         x = x.encode('utf-8')
     return urlquote(x, '')