bear / python-twitter

A Python wrapper around the Twitter API.
Apache License 2.0
3.41k stars 957 forks source link

Fix typing issue in `Api._ParseAndCheckTwitter` #606

Closed Fitblip closed 2 years ago

Fitblip commented 5 years ago

Right now whenever the twitter API returns an un-parsable response that isn't explicitly known/handled, the TwitterException sets the message parameter to a set type, not a dict type or a str type (which is used in some cases elsewhere).

This is causing errors for me as I'm inspecting this exception for graceful error handling, and received a set much to my surprise! Looks to me like a copy/paste bug.

I'd like to have it be a dict, but if you think a str is more appropriate that works too!

Thanks for the great library :)


This change is Reviewable

webtweakers commented 4 years ago

I created another issue to handle this a bit more thorough: https://github.com/bear/python-twitter/issues/639

Fitblip commented 2 years ago

Hi @bear, I think this merge might have produced syntactically incorrect python.

Looks like it was previously fixed in https://github.com/bear/python-twitter/commit/eed985f1cb5cd3dadfbd42732bb02c319a4f4653 but with this change/diff it is now broken again 😬

https://github.com/bear/python-twitter/blob/1a148ead5029d06bec58c1cbc879764aa4b2bc74/twitter/api.py#L5093