Closed titocosta closed 4 years ago
In order to work properly with parameters passed as unicode strings, the correct way to check if a parameter is a string in Python 2.x in newsapi_client.py is:
newsapi_client.py
if isinstance(q, basestring)
instead of:
if type(q) == str
basestring includes both str and unicode.
basestring
str
unicode
See python docs for reference.
Hi @titocosta ,
Thanks for reporting this. I will add to add this as an enhancement.
Matt
Completed with #40
In order to work properly with parameters passed as unicode strings, the correct way to check if a parameter is a string in Python 2.x in
newsapi_client.py
is:if isinstance(q, basestring)
instead of:
if type(q) == str
basestring
includes bothstr
andunicode
.See python docs for reference.