if self.e.headers.get('Content-Encoding') == 'gzip':
buf = StringIO(data)
f = gzip.GzipFile(fileobj=buf)
- self.response_data = f.read()
+ data = f.read()
+ if len(data) == 0:
+ data = {}
+ elif "json" == self.format:
+ data = json.loads(data.decode('utf8'))
else:
- self.response_data = data
+ data = data.decode('utf8')
+ self.response_data = data
super(TwitterHTTPError, self).__init__(str(self))
def __str__(self):
text="I think yer swell!")
# Get the members of tamtar's list "Things That Are Rad"
- t._("tamtar")._("things-that-are-rad").members()
-
- # Note how the magic `_` method can be used to insert data
- # into the middle of a call. You can also use replacement:
- t.user.list.members(user="tamtar", list="things-that-are-rad")
+ t.lists.members(owner_screen_name="tamtar", slug="things-that-are-rad")
# An *optional* `_timeout` parameter can also be used for API
# calls which take much more time than normal or twitter stops