From: Josh Roesslein Date: Wed, 14 Oct 2009 20:19:29 +0000 (-0500) Subject: Encode parameters in binder to utf-8 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f6ae55884c3ee3fea62207b79d1425353727f0d7;p=tweepy.git Encode parameters in binder to utf-8 --- diff --git a/tweepy/binder.py b/tweepy/binder.py index 3bf1bf5..8000c32 100644 --- a/tweepy/binder.py +++ b/tweepy/binder.py @@ -44,8 +44,9 @@ def bind_api(path, parser, allowed_param=[], method='GET', require_auth=False, if allowed_param: parameters = {} for idx, arg in enumerate(args): + encoded_arg = arg.encode('utf-8') # must encode parameters to utf-8 try: - parameters[allowed_param[idx]] = arg + parameters[allowed_param[idx]] = encoded_arg except IndexError: raise TweepError('Too many parameters supplied!') for k, arg in kargs.items(): @@ -55,7 +56,7 @@ def bind_api(path, parser, allowed_param=[], method='GET', require_auth=False, raise TweepError('Multiple values for parameter %s supplied!' % k) if k not in allowed_param: raise TweepError('Invalid parameter %s supplied!' % k) - parameters[k] = arg + parameters[k] = arg.encode('utf-8') else: if len(args) > 0 or len(kargs) > 0: raise TweepError('This method takes no parameters!')