Patchwork [04,of,11,py3] pycompat: introduce an alias for urllib.unquote

login
register
mail settings
Submitter Augie Fackler
Date Oct. 9, 2016, 2:16 p.m.
Message ID <d333d64709648be4b31a.1476022606@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/16999/
State Accepted
Headers show

Comments

Augie Fackler - Oct. 9, 2016, 2:16 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1476018145 14400
#      Sun Oct 09 09:02:25 2016 -0400
# Node ID d333d64709648be4b31a7fcf25ff2505c0c4c78c
# Parent  b5f982c40f6721ab2db8ddcfe1b4f8df44ab25a2
pycompat: introduce an alias for urllib.unquote

We have to use unquote_to_bytes on Python 3, so we need an abstraction
for this.

Patch

diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -21,6 +21,7 @@  if not ispy3:
     import Queue as _queue
     import SocketServer as socketserver
     import urlparse
+    url_unquote = urlparse.unquote
     import xmlrpclib
 else:
     import http.client as httplib
@@ -29,6 +30,7 @@  else:
     import queue as _queue
     import socketserver
     import urllib.parse as urlparse
+    url_unquote = urlparse.unquote_to_bytes
     import xmlrpc.client as xmlrpclib
 
 if ispy3: