Skip to content

Commit ace171a

Browse files
committed
Sending parsed emails
1 parent d0f630a commit ace171a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

email/1.2.0/src/app.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ def default(o):
4040
if isinstance(o, set):
4141
return list(o)
4242
if isinstance(o, bytes):
43-
return o.decode("utf-8")
43+
try:
44+
return o.decode("utf-8")
45+
except:
46+
print("Failed parsing utf-8 string")
47+
return o
4448

4549

4650
class Email(AppBase):
@@ -335,7 +339,7 @@ def merge(d1, d2):
335339

336340
return {
337341
"success": True,
338-
"reason": emails,
342+
"reason": json.loads(json.dumps(emails, default=default)),
339343
}
340344

341345
def parse_email_file(self, file_id, file_extension):

0 commit comments

Comments
 (0)