req.py
changeset 10687 d394bfcd8c25
parent 10672 f6f425a54a8d
child 10694 7ece2df9cc5c
--- a/req.py	Mon Oct 05 17:10:36 2015 +0200
+++ b/req.py	Wed Sep 16 11:28:07 2015 +0200
@@ -22,7 +22,7 @@
 from warnings import warn
 from datetime import time, datetime, timedelta
 
-from six import text_type
+from six import PY2, text_type
 from six.moves.urllib.parse import parse_qs, parse_qsl, quote as urlquote, unquote as urlunquote, urlsplit, urlunsplit
 
 from logilab.common.decorators import cached
@@ -313,7 +313,7 @@
         necessary encoding / decoding. Also it's designed to quote each
         part of a url path and so the '/' character will be encoded as well.
         """
-        if isinstance(value, unicode):
+        if PY2 and isinstance(value, unicode):
             quoted = urlquote(value.encode(self.encoding), safe=safe)
             return unicode(quoted, self.encoding)
         return urlquote(str(value), safe=safe)