# HG changeset patch # User Goffi # Date 1585778340 -7200 # Node ID 642cd2435e26b4c195ca07b0f9ac4a7171a8841e # Parent 65958c3c98cbaa97a78730c4158204914509529d chat: fixed media_type guessing when Path is used for attachment diff -r 65958c3c98cb -r 642cd2435e26 cagou/plugins/plugin_wid_chat.py --- a/cagou/plugins/plugin_wid_chat.py Wed Apr 01 23:59:00 2020 +0200 +++ b/cagou/plugins/plugin_wid_chat.py Wed Apr 01 23:59:00 2020 +0200 @@ -1025,7 +1025,7 @@ def addAttachment(self, file_path, media_type=None): file_path = Path(file_path) if media_type is None: - media_type = mimetypes.guess_type(file_path, strict=False)[0] + media_type = mimetypes.guess_type(str(file_path), strict=False)[0] if not self.attachments_to_send.show_resize and media_type is not None: # we check if the attachment is an image and if it's too large. # If too large, the reduce size check box will be displayed, and checked by