oauth.py guesses whether it is running under Python 3 by the existance of urllib.parse.urllib_parse and urllib.parse.urlencode. The code then uses urlencode's safe parameter if it believes it's running under Python 3. Unfortunately the guess fails when using Future, a library for writing clean Python 3 code that is backwards compatible with Python 2, since Future manipulates some builtins.
This change applies the version test that isn't confused by the use of Futures. It's the same test used by the Six library.
from __future__ import print_function
from __future__ import print_function
from random import getrandbits
from random import getrandbits
+import sys
+from time import time
+
+PY3 = sys.version_info[0] == 3
try:
import urllib.parse as urllib_parse
from urllib.parse import urlencode
try:
import urllib.parse as urllib_parse
from urllib.parse import urlencode
except ImportError:
import urllib2 as urllib_parse
from urllib import urlencode
except ImportError:
import urllib2 as urllib_parse
from urllib import urlencode
import hashlib
import hmac
import hashlib
import hmac