From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77DE3C35257 for ; Fri, 2 Oct 2020 23:29:45 +0000 (UTC) Received: by mail.kernel.org (Postfix) id 571E62074B; Fri, 2 Oct 2020 23:29:45 +0000 (UTC) Received: from [192.168.1.64] (unknown [89.36.78.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 13B552072E for ; Fri, 2 Oct 2020 23:29:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601681385; bh=6VuZWP3OlaCzSoyosQjZ+WD5/QKtmIGmTIj3abESDcw=; h=From:List-Id:To:Subject:Date:In-Reply-To:References:From; b=ZgoI9mtjeMrc2p8Gcd/0Up6DMRzmVMAD5AuXgNlw8MwjSaqeW7rHShxrUBM44fqzW vLZl6oKC+1sWBxra7iGgiDThGEIkdvMPh8ib8Zb2Ojrcp44eftuItHLb3D6tdNvWsR ywlJPyjYsjJv9pIHplKb0FwXMd7xffdr9bACjP5w= From: Konstantin Ryabitsev List-Id: To: signatures@kernel.org Subject: [PATCH 07/10] Set charset in order to generate MIME headers Date: Fri, 2 Oct 2020 19:29:12 -0400 Message-Id: <20201002232915.1728301-8-konstantin@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201002232915.1728301-1-konstantin@linuxfoundation.org> References: <20201002232915.1728301-1-konstantin@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Patch-Hashes: v=1; h=sha256; g=4b3a37bebbfa46c8cd7e472e3664b6c8d9eb08b8; i=rKlQ8NPZ+uOuBQv2mheLeJpb/OHMVU/Kwz+EESPavLs=; m=yxWa1ySwSMXHjOMk41lYS1f6jl52WmA/bw//0b8hf2U=; p=g4YOAc9SHmP/o9im7VElGj9532/1eY4jZHThrWwN3ck= X-Patch-Sig: m=pgp; i=konstantin@linuxfoundation.org; s=0xB6C41CE35664996C; b=iHUEABYIAB0WIQR2vl2yUnHhSB5njDW2xBzjVmSZbAUCX3e35QAKCRC2xBzjVmSZbC7xAP4srcC mJviGi9dVun3R9HtogHBWM5gJFJOOTB6CAU5gRwD/QflfzTIWd8bcpcblmcxvRTj/n3tP+Ril8CFo lTN6PQU= Apparently, merely passing policy= doesn't generate the full set of required headers, so make sure we do set_charset('utf-8'). Reported-by: Michał Mirosław Signed-off-by: Konstantin Ryabitsev --- b4/ty.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/b4/ty.py b/b4/ty.py index 382ce93..cbee06a 100644 --- a/b4/ty.py +++ b/b4/ty.py @@ -426,9 +426,9 @@ def send_messages(listing, gitdir, outdir, branch, since='1.week'): outgoing += 1 outfile = os.path.join(outdir, '%s.thanks' % slug) logger.info(' Writing: %s', outfile) - bout = msg.as_string(policy=b4.emlpolicy) + msg.set_charset('utf-8') with open(outfile, 'wb') as fh: - fh.write(bout.encode('utf-8')) + fh.write(msg.as_bytes()) logger.debug('Cleaning up: %s', jsondata['trackfile']) fullpath = os.path.join(datadir, jsondata['trackfile']) os.rename(fullpath, '%s.sent' % fullpath) -- 2.26.2