From 40e2c383c85e2357784b849474d2fa13fc1ae29e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 24 Sep 2022 07:43:49 +0530 Subject: [PATCH] Go back to using ascii-ized filenames for Amazon Apparently, their email service has stopped reading metadata from file contents. Hurray! --- src/calibre/gui2/email.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/email.py b/src/calibre/gui2/email.py index d9e8a8bd4d..d73a0dc84c 100644 --- a/src/calibre/gui2/email.py +++ b/src/calibre/gui2/email.py @@ -165,7 +165,12 @@ def send_mails(jobnames, callback, attachments, to_s, subjects, # irony that they are called "tech" companies. # https://bugs.launchpad.net/calibre/+bug/1989282 from calibre.utils.short_uuid import uuid4 - aname = f'{uuid4()}.' + aname.rpartition('.')[-1] + if '@kindle.com' in to: + # https://www.mobileread.com/forums/showthread.php?t=349290 + from calibre.utils.filenames import ascii_filename + aname = ascii_filename(aname) + else: + aname = f'{uuid4()}.' + aname.rpartition('.')[-1] subject = uuid4() text = uuid4() job = ThreadedJob('email', description, gui_sendmail, (attachment, aname, to,