Twitter-API-v2-sample-code icon indicating copy to clipboard operation
Twitter-API-v2-sample-code copied to clipboard

ValueError: Only unicode objects are escapable. Got None of type <class 'NoneType'>.

Open kiasar opened this issue 4 years ago • 1 comments

Describe the bug When I run this code on python 3.7, it will always say: "There may have been an issue with the consumer_key or consumer_secret you entered." But I'm pretty sure they are right.

The error is this:

/usr/local/lib/python3.7/dist-packages/oauthlib/oauth1/rfc5849/utils.py in escape(u)
     48     if not isinstance(u, str):
     49         raise ValueError('Only unicode objects are escapable. ' +
---> 50                          'Got {!r} of type {}.'.format(u, type(u)))
     51     # Letters, digits, and the characters '_.-' are already treated as safe
     52     # by urllib.quote(). We need to add '~' to fully support rfc5849.

ValueError: Only unicode objects are escapable. Got None of type <class 'NoneType'>.

kiasar avatar Nov 22 '21 06:11 kiasar

Is there any chance that you might have copied and pasted any hidden or special characters when you set the environment variables?

Which sample are you trying to run?

andypiper avatar Nov 22 '21 14:11 andypiper