xdevplatform / Twitter-API-v2-sample-code

Sample code for the Twitter API v2 endpoints
https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api
Apache License 2.0
2.66k stars 984 forks source link

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

Open kiasar opened 2 years ago

kiasar commented 2 years ago

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'>.
andypiper commented 2 years ago

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?