Lines Matching refs:safe
753 def __init__(self, safe): argument
755 self.safe = _ALWAYS_SAFE.union(safe)
763 res = chr(b) if b in self.safe else '%{:02X}'.format(b)
767 def quote(string, safe='/', encoding=None, errors=None): argument
819 return quote_from_bytes(string, safe)
821 def quote_plus(string, safe='', encoding=None, errors=None): argument
830 return quote(string, safe, encoding, errors)
831 if isinstance(safe, str):
835 string = quote(string, safe + space, encoding, errors)
838 def quote_from_bytes(bs, safe='/'): argument
847 if isinstance(safe, str):
849 safe = safe.encode('ascii', 'ignore')
851 safe = bytes([c for c in safe if c < 128])
852 if not bs.rstrip(_ALWAYS_SAFE_BYTES + safe):
855 quoter = _safe_quoters[safe]
857 _safe_quoters[safe] = quoter = Quoter(safe).__getitem__
860 def urlencode(query, doseq=False, safe='', encoding=None, errors=None, argument
900 k = quote_via(k, safe)
902 k = quote_via(str(k), safe, encoding, errors)
905 v = quote_via(v, safe)
907 v = quote_via(str(v), safe, encoding, errors)
912 k = quote_via(k, safe)
914 k = quote_via(str(k), safe, encoding, errors)
917 v = quote_via(v, safe)
920 v = quote_via(v, safe, encoding, errors)
928 v = quote_via(str(v), safe, encoding, errors)
934 elt = quote_via(elt, safe)
936 elt = quote_via(str(elt), safe, encoding, errors)