from tweepy.error import is_rate_limit_error_message, RateLimitError, TweepError
from tweepy.models import Model
-from tweepy.utils import convert_to_utf8_str
re_path_template = re.compile(r'{\w+}')
if arg is None:
continue
try:
- self.session.params[self.allowed_param[idx]] = convert_to_utf8_str(arg)
+ self.session.params[self.allowed_param[idx]] = str(arg)
except IndexError:
raise TweepError('Too many parameters supplied!')
if k in self.session.params:
raise TweepError('Multiple values for parameter %s supplied!' % k)
- self.session.params[k] = convert_to_utf8_str(arg)
+ self.session.params[k] = str(arg)
log.debug("PARAMS: %r", self.session.params)
return atag[start:end]
-def convert_to_utf8_str(arg):
- # written by Michael Norton (http://docondev.blogspot.com/)
- if isinstance(arg, str):
- arg = arg.encode('utf-8')
- elif not isinstance(arg, bytes):
- arg = str(arg).encode('utf-8')
- return arg
-
-
def list_to_csv(item_list):
if item_list:
return ','.join(map(str, item_list))