From c7af7fb0098cc598467762c0ca6d4b354116d23c Mon Sep 17 00:00:00 2001 From: fitnr Date: Wed, 17 Feb 2016 12:39:10 -0500 Subject: [PATCH] check error on posting data --- tweepy/binder.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tweepy/binder.py b/tweepy/binder.py index e026f4b..5d3fb8f 100644 --- a/tweepy/binder.py +++ b/tweepy/binder.py @@ -188,6 +188,13 @@ def bind_api(**config): timeout=self.api.timeout, auth=auth, proxies=self.api.proxy) + except UnicodeEncodeError: + resp = self.session.request(self.method, + full_url, + data=self.post_data.decode('utf-8'), + timeout=self.api.timeout, + auth=auth, + proxies=self.api.proxy) except Exception as e: six.reraise(TweepError, TweepError('Failed to send request: %s' % e), sys.exc_info()[2]) -- 2.25.1