Skip to content

Fix bare except clause in twython/api.py#555

Open
koteshyelamati wants to merge 1 commit into
ryanmcgrath:masterfrom
koteshyelamati:master
Open

Fix bare except clause in twython/api.py#555
koteshyelamati wants to merge 1 commit into
ryanmcgrath:masterfrom
koteshyelamati:master

Conversation

@koteshyelamati

Copy link
Copy Markdown

Replace bare except: with except (UnicodeEncodeError, AttributeError): in the unicode2utf8 helper.

Bare except: catches BaseException (including SystemExit and KeyboardInterrupt), which is almost never intended. Since this block handles UTF-8 encoding of text, UnicodeEncodeError covers encoding failures and AttributeError covers cases where the object has no encode method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant