Commits

Andriy Kornatskyy committed 4499253

Added url_escape function

Comments (0)

Files changed (2)

src/wheezy/core/comp.py

                                             dict.__repr__(self))
 
 
+if PY3:  # pragma: nocover
+    from urllib.parse import quote_plus
+    url_escape = quote_plus
+else:  # pragma: nocover
+    from urllib import quote_plus
+    url_escape = lambda s: quote_plus(b(s, 'utf-8'))
+
+
 try:  # pragma: nocover
     from email.utils import parsedate
 except ImportError:  # pragma: nocover

src/wheezy/core/url.py

 """ ``url`` module
 """
 
+from wheezy.core.comp import url_escape
 from wheezy.core.comp import urlunsplit