From 8d343774198152a97503f5f401ba167ca4f03cd0 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Tue, 7 Feb 2017 14:51:46 +0100 Subject: [PATCH] Added python3 support Without this, it crashes with a `UnicodeDecodeError` --- fbchat/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fbchat/client.py b/fbchat/client.py index 0460f3c..3fb0f6b 100644 --- a/fbchat/client.py +++ b/fbchat/client.py @@ -498,7 +498,7 @@ class Client(object): :param image: path to a local image to send """ mimetype = guess_type(image)[0] - image_id = self.uploadImage({'file': (image, open(image), mimetype)}) + image_id = self.uploadImage({'file': (image, open(image, 'rb'), mimetype)}) return self.send(recipient_id, message, message_type, None, image_id) def uploadImage(self, image):