File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,11 @@ def parse(mime_mail):
46
46
@staticmethod
47
47
def extract_message (message ):
48
48
body = message .get_payload (decode = True )
49
- return message ['Content-Type' ], body .decode (encoding = chardet .detect (body )['encoding' ])
49
+ charset = chardet .detect (body )['encoding' ]
50
+ if charset is None :
51
+ charset = 'utf-8'
52
+
53
+ return message ['Content-Type' ], body .decode (encoding = charset )
50
54
51
55
@staticmethod
52
56
def parse_header (parsed_mail , field : str ) -> str :
Original file line number Diff line number Diff line change 10
10
setup (
11
11
name = 'email2slack' ,
12
12
13
- version = '1.0.0a2 ' ,
13
+ version = '1.0.0a3 ' ,
14
14
15
15
description = 'MIME E-mail forwarding script for Slack written in Python' ,
16
16
long_description = long_description ,
You can’t perform that action at this time.
0 commit comments