mercurial/urllibcompat.py
changeset 51686 493034cc3265
parent 50926 18c8c18993f0
child 51696 7f0cb9ee0534
equal deleted inserted replaced
51685:39e2b2d062c1 51686:493034cc3265
   107         b"SimpleHTTPRequestHandler",
   107         b"SimpleHTTPRequestHandler",
   108         b"CGIHTTPRequestHandler",
   108         b"CGIHTTPRequestHandler",
   109     ),
   109     ),
   110 )
   110 )
   111 
   111 
       
   112 
   112 # urllib.parse.quote() accepts both str and bytes, decodes bytes
   113 # urllib.parse.quote() accepts both str and bytes, decodes bytes
   113 # (if necessary), and returns str. This is wonky. We provide a custom
   114 # (if necessary), and returns str. This is wonky. We provide a custom
   114 # implementation that only accepts bytes and emits bytes.
   115 # implementation that only accepts bytes and emits bytes.
   115 def quote(s, safe='/'):
   116 def quote(s, safe='/'):
   116     # bytestr has an __iter__ that emits characters. quote_from_bytes()
   117     # bytestr has an __iter__ that emits characters. quote_from_bytes()