Exemplo n.º 1
0
 def urlquote(s, safe='/'):
     if isinstance(s, _real_unicode):
         # Pretend to be py3 by encoding the URI automatically.
         s = s.encode('utf8')
     return _urlquote(s, safe)
Exemplo n.º 2
0
 def urlquote(text):
     """Fixup wrapper to make C{urllib.quote} behave as in Python 3"""
     return _urlquote(text if isinstance(text, bytes)
                      else text.encode('utf-8'))
Exemplo n.º 3
0
 def urlquote(s, safe='/'):
     if isinstance(s, _real_unicode):
         # Pretend to be py3 by encoding the URI automatically.
         s = s.encode('utf8')
     return _urlquote(s, safe)
Exemplo n.º 4
0
 def urlquote(string, safe=b'/'):
     if not isinstance(safe, bytes):
         safe = safe.encode('ascii', 'ignore')
     if not isinstance(string, bytes):
         string = string.encode('utf8')
     return _urlquote(string, safe)