From patchwork Sun Oct 27 15:33:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brandon Maier X-Patchwork-Id: 13852690 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41BAF1E50B for ; Sun, 27 Oct 2024 15:34:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730043240; cv=none; b=dXCKMBSf7L54Y4uzytbjoV/BrL0x9orxulM6tdzZJjPYzxvBW5h6t+DyGlsU9WWl11KbyC/X4LyNnsGEjJfzQ9lmMuvuQOT2dvVM/DtyYm8gXWe8XyjGZcN2fiujoEOWp4imd1ygt55FQBlFHvb5beMiM2MBkZ/uy0hTo3K2Vb4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730043240; c=relaxed/simple; bh=s0GkUkyI+xw4qoZyT7emCLlXC/bH1dUlbaE2XltqqKI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=m3BXrzgldkYY2QfHTildqsNZO8v8AUrwDi2zSs9VfoXgU7WlPzda8lEtfYCpdoUpa/e0xKZlTuQ9v7fiDp+sA1Zi17umQNg92QgCjtBICMZG8lbNACQ1BMyCv5gm2I/gdYrAnesP6cZ+JDWINlsty9+pWmfWsFP1DvZdaHb2+LU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EbE/ZiZM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EbE/ZiZM" Received: by smtp.kernel.org (Postfix) id 2B931C4CEC7; Sun, 27 Oct 2024 15:34:00 +0000 (UTC) Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 484D6C4CEC3 for ; Sun, 27 Oct 2024 15:33:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.kernel.org 484D6C4CEC3 Authentication-Results: smtp.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-3a4e30bffe3so9138535ab.3 for ; Sun, 27 Oct 2024 08:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730043238; x=1730648038; darn=kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=zTARtdoY1LxckmFLu4z4WfI+G6/jlXJBnTBQVa55xSo=; b=EbE/ZiZMPbCAZ8oJRZr9Ga1uRb9ylNbcFf1VWKfaKCcgAmbWuFInql39gPqN7zePHz VNLH4CRdRZu5nTnpty0Y/GJxhKR2teaNrxgaOCi5MnJqVqYY+HVBan0iu9cbulCpZNSa mjfYD9ulBdPTulqsMth66idYvzdYgVPqTDE+yq2o+DdZ5y6lKBCdQPP50Cz0GXjLzy8g 6vWSsFDFYaBtSh/Plydf7degw86kt2iiOLsoYONWawVzYjQ6bITwezNf8WH/y2qvLPtI OWLGA47tEUD7WyvVi9WCJEUI0CEpZgHFT+2UerOlPoysTKemPzeQdnIBFaLm4dgjBYUS lYRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730043238; x=1730648038; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zTARtdoY1LxckmFLu4z4WfI+G6/jlXJBnTBQVa55xSo=; b=hRqc2d1X8RE5VTkNl1I/GSVBrwEQK23psIW1hZq8tg0r2uumKb54/KjTd+pi7FoiNJ QEZ0VVPDwAc5hN2oKygnuRKu1MgtzLBG4YqD3qOx/g5m+c+1xLqPGlXDZ+KL3CQsHV67 w9vRCiSjrkheeyKenC+v8Q1YW85Zy2rI0EotbYoFrjyDRLHVi+BnsHTrO5Npul6DrSda oUSakmMJUmnH9+jVvMfcB/BGT0dyLKW0568zPtiXCMnv4OUVtB085LJs6zgqvTihe9d/ GP9ei3F3+K/Yi71zQk23T0bDo9B/QGq+uEzkB2fc1id98aaOvnezPAGhSoHVC0Rr3YNp KY9A== X-Gm-Message-State: AOJu0YyhsbzFZFu/DCrIJWvaa2PrVPF/Ev5nIgXj0hWW8RkUrj+nHk/F NxQEuTx5mL9iNL82QWsXmbpa3t9CmdM1pXwQLhGwyxjbjCyanB5ETOnXiSsl X-Google-Smtp-Source: AGHT+IEJAVDxZ2QBdGtOYi+HJIfBVleBC/HBEq3zZPRGM3QaAtQuBjJjDb0IT2naFSx6Yvz0EEF+Qg== X-Received: by 2002:a05:6e02:1a44:b0:3a4:ec57:d7b3 with SMTP id e9e14a558f8ab-3a4ed294445mr45091405ab.12.1730043238217; Sun, 27 Oct 2024 08:33:58 -0700 (PDT) Received: from localhost (207-191-210-45.dhcp.imoncommunications.net. [207.191.210.45]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4dc72617208sm1219716173.63.2024.10.27.08.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Oct 2024 08:33:57 -0700 (PDT) From: Brandon Maier Date: Sun, 27 Oct 2024 10:33:53 -0500 Subject: [PATCH b4 1/6] src/tests: check trailer extinfo Precedence: bulk X-Mailing-List: tools@linux.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241027-trailer-special-chars-v1-1-1bd180dba425@gmail.com> References: <20241027-trailer-special-chars-v1-0-1bd180dba425@gmail.com> In-Reply-To: <20241027-trailer-special-chars-v1-0-1bd180dba425@gmail.com> To: "Kernel.org Tools" Cc: Konstantin Ryabitsev , Brandon Maier X-Mailer: b4 0.15-dev The b4.LoreTrailer.__eq__ ignores the 'extinfo' of a trailer. So the trailer test is not checking that extinfo is parsed correctly. Signed-off-by: Brandon Maier --- src/tests/test___init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/test___init__.py b/src/tests/test___init__.py index 297e5120a8c8adf241660f06e9a83c1ff4a0fd3a..dbc92c7e8352728c2f2a951f7b9b1496ccbaf2c5 100644 --- a/src/tests/test___init__.py +++ b/src/tests/test___init__.py @@ -79,6 +79,7 @@ def test_parse_trailers(sampledir, source, expected): mytype, myname, myvalue, myextinfo = expected.pop(0) mytr = b4.LoreTrailer(name=myname, value=myvalue, extinfo=myextinfo) assert tr == mytr + assert tr.extinfo == mytr.extinfo assert tr.type == mytype From patchwork Sun Oct 27 15:33:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brandon Maier X-Patchwork-Id: 13852691 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67D5E1E50B for ; Sun, 27 Oct 2024 15:34:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730043242; cv=none; b=SC1BMQ8WeTBH3aDW9vLRBopdASqyPJ8VgsJXFtnfvajlRnJglQzlhRMqNbcruon1XzhH/TbeKMioVlidsYnJ2PRyaMKc1htpNYxe5UP0A3t65W2o0sqwin2jBoNEUuFeBFwfpq2V7xl2l51JbvJ8OzXSB5zoIu0w+TSp7jBbO3o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730043242; c=relaxed/simple; bh=bl0MQPpbsfgbfqmd1BPBHQsu6XfUgO+CUPuk0F2si2k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CiPQZpQfpFwqtunL1sKUQFazvUIoPOVeNb7Si3Yv3+KCKaMnQGbufUKGqrSGelY6dgcq4H8vlm5FW3kQJ5NsqVXQmLawa4gqK34h858i0hgw2/Rh81FfO4SqA4PyUtxOUVx5/+Wwl49UqDLP1zBYDgrduKtUiC2G86CXXkShxP4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ORo3Deav; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ORo3Deav" Received: by smtp.kernel.org (Postfix) id 80F35C4CEC7; Sun, 27 Oct 2024 15:34:01 +0000 (UTC) Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 943BEC4CEC3 for ; Sun, 27 Oct 2024 15:34:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.kernel.org 943BEC4CEC3 Authentication-Results: smtp.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-83abe7fc77eso138878539f.0 for ; Sun, 27 Oct 2024 08:34:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730043240; x=1730648040; darn=kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=feNtiNDrvPASm9AMoQZM6ZYoF2Qw3Q8IJGxUNfSfC08=; b=ORo3DeavlKUbYbASJi9r5HIrcU9CErfuK1OfRCK/aoWKK8fdWMrqO3CGdsrfrPn7ad DmKmMqi6jn9CHYhb5FjLataYSAg0PDuCtkRz6/ecHE5PqcNG3DVb9K7WMGsBU4BTp1Q5 ua7OZNZowvrpbQaLOS//np1frG0lw5PSLZ0FZ4/Y18+mWHaGBjKnJM6kRzsOn0ev1Cye UB0a5/S/DowiN6ws0IwDJvcn6ZixH8yaNfQNYgJ+iRa4caakMC+7eUBBO0Od+v0EZLvB 41mUWhqlFen1bEx4c/vC5NCkr+pFoHvRbjwRUjxpJWTQxXukTcqUfuSN/Dl4M9aUN3li U3ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730043240; x=1730648040; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=feNtiNDrvPASm9AMoQZM6ZYoF2Qw3Q8IJGxUNfSfC08=; b=CNZNDcCqmRtMSiHcotYuPwoLvQOxbqxw+z9Jh9dHMRlXj3FHGRDp9YCUr5k/nvpDE6 0kulwkEiH4hnM00nXiz2Hqft0I8PUuPS931f1fvMMvWimLL3mjYrr0M5P2MCTOFitOV0 FKkCBCTgyorh7QOzEqEkhF39ENw3qAuEnOB9YYd1UJKaO6f9yf+ALcE6//CuyOtiX6tU 3xKFrAAbZXv3amaA8j7QYS68uJn7mJW+xYXva8WQpc/+obaNW0B13ZkzqYX3lse7+XcD pFe0Wu4s+AIIMxFadCo+vrsnIPZO/qzatMuyVVYCU3V4B87dlvuru6Yv9nR4lh1xnAKs L5Jw== X-Gm-Message-State: AOJu0YyzztDpka5MsXc/2whz2YbghRehiLW5Wz3DPIOeGVInA0ITYnl6 z+zVYxjTtZCZlWHvMJp/4A2Wwk4CE/mLk0o6cZePCRkaQXrxEPGBt3kBsRwC X-Google-Smtp-Source: AGHT+IEtSju0b2FsMOFANS2SH8vcE+le7Wchdk8vzeDnbgMv3uYQ7DjSGCjPKRr/AfflnJmvwj+tyQ== X-Received: by 2002:a05:6602:6c0e:b0:835:4cb5:4fa7 with SMTP id ca18e2360f4ac-83b1c4b4ff6mr403997039f.12.1730043239572; Sun, 27 Oct 2024 08:33:59 -0700 (PDT) Received: from localhost (207-191-210-45.dhcp.imoncommunications.net. [207.191.210.45]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4dc727512afsm1210782173.90.2024.10.27.08.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Oct 2024 08:33:59 -0700 (PDT) From: Brandon Maier Date: Sun, 27 Oct 2024 10:33:54 -0500 Subject: [PATCH b4 2/6] src/tests: fix trailer test hiding parser errors Precedence: bulk X-Mailing-List: tools@linux.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241027-trailer-special-chars-v1-2-1bd180dba425@gmail.com> References: <20241027-trailer-special-chars-v1-0-1bd180dba425@gmail.com> In-Reply-To: <20241027-trailer-special-chars-v1-0-1bd180dba425@gmail.com> To: "Kernel.org Tools" Cc: Konstantin Ryabitsev , Brandon Maier X-Mailer: b4 0.15-dev The trailer parsing test compares the values of the b4.LoreTrailer object created from the test input against a b4.LoreTrailer object created from our expected test input. This means if there is an error in how b4.LoreTrailer parses input, it won't be detected. This was discovered from a reported bug with parsing email trailers with embedded ','. Bug: https://github.com/mricon/b4/issues/50 --- src/tests/test___init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tests/test___init__.py b/src/tests/test___init__.py index dbc92c7e8352728c2f2a951f7b9b1496ccbaf2c5..7fe43b0158460f06d0a2b52d2689d26e7ef7f840 100644 --- a/src/tests/test___init__.py +++ b/src/tests/test___init__.py @@ -57,7 +57,7 @@ def test_save_git_am_mbox(sampledir, tmp_path, source, regex, flags, ismbox): @pytest.mark.parametrize('source,expected', [ ('trailers-test-simple', - [('person', 'Reviewed-By', 'Bogus Bupkes ', None), + [('person', 'Reviewed-by', 'Bogus Bupkes ', None), ('utility', 'Fixes', 'abcdef01234567890', None), ('utility', 'Link', 'https://msgid.link/some@msgid.here', None), ]), @@ -77,10 +77,14 @@ def test_parse_trailers(sampledir, source, expected): assert len(expected) == len(trs) for tr in trs: mytype, myname, myvalue, myextinfo = expected.pop(0) + assert tr.name == myname + assert tr.value == myvalue + assert tr.extinfo == myextinfo + assert tr.type == mytype + mytr = b4.LoreTrailer(name=myname, value=myvalue, extinfo=myextinfo) assert tr == mytr assert tr.extinfo == mytr.extinfo - assert tr.type == mytype @pytest.mark.parametrize('source,serargs,amargs,reference,b4cfg', [ From patchwork Sun Oct 27 15:33:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brandon Maier X-Patchwork-Id: 13852692 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 270351E50B for ; Sun, 27 Oct 2024 15:34:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730043243; cv=none; b=XQsEg1Icnc58I5j7X9zelWF7SvLRl+cbkJO8RJqDE3VSlP2Dfr+HzzAqoeR+tyhPAD8Hmvp/C8kqQ0eDIidqW3dx3dvVsv97VG0C8LeqAuS/Qr47NX7GKQw87FLI1PBKOXfbbSUmfMaDxVo4USuwwQWtgS0rAflBC2IZhdW/igE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730043243; c=relaxed/simple; bh=FoJJ2h90LlibaI4SbrmizAGIBwMOx15jNQuyL67WDHw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dPtLQfnz/9Kkc/uAEcSsnNgZfTokDrY21GSEqCBjPIHLR59JLln6VlEHkoD7jPsK4C1PvDkJBv4q86vBnxTQqlVCnrjgdQnuEMvfYvcGgNxkmzzCEMUDVMwHd0LguuxVoSYMklO7pCVFM1xOcJlX/F2NB2Pfl8SNxASfLBF+8Ko= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dMK+ddPQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dMK+ddPQ" Received: by smtp.kernel.org (Postfix) id E83B9C4CEEB; Sun, 27 Oct 2024 15:34:02 +0000 (UTC) Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 192D9C4CEC3 for ; Sun, 27 Oct 2024 15:34:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.kernel.org 192D9C4CEC3 Authentication-Results: smtp.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-83b1d545c04so60556339f.2 for ; Sun, 27 Oct 2024 08:34:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730043241; x=1730648041; darn=kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=bTKpU7tb6k7g67R2E6TGtP/hOf6u3m1LQ07VQt+VPxQ=; b=dMK+ddPQyadVVadnrZMZ053xAG5pnkvs9ZNt+eTSMR0PwMptmhU34XJRmJKqr7GDRq Sf682n/of9stIv6hyz+0qc4O70os1VeCjTZfRAWlTWY1X7ZBs/ARnbSbwys/acEC4p4Y QkvDIHEWHL2UtP4sYzoY9YPaCSMk1HzL8zWtCh7om/z30pOD6j99BVOyIt05R1dyBFrW pTnib+bbMRsi84TvZ4ZVZhG9Xmx36rcZ0DOIhYpGjR56UaFHRio+ANqdFvnuy+5zHSR3 28kBb+jxJNmvBCjXiUtcmrCG0r6CWHJ/jJ2faNIyBkZGhArLxg9uVHHgILIi2UX4VE4/ DJ1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730043241; x=1730648041; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bTKpU7tb6k7g67R2E6TGtP/hOf6u3m1LQ07VQt+VPxQ=; b=oapxlAsSVAoX5IuTQW/GRUc9gAva+JBw6CPbrgSrCvyDZlx+gJ9FaiiKe+2Mz+qzMp bKG5Re2JF/4T11OX3/b7f49qeUXTFsPBBCr5N1eBXdZmzXfC/ZWAeUCvLpe27+vO/9f3 sdk4cuKXa8q0JSWb9XuDGj8YFhEgWUHQ4hyECr9yRxhqQNe5+bo5YN3cy2QAM1fzfv2/ UOZ7hhzPDOd3KPDHQIct+ol70IPi/uNsWrWWigam2OT6ARgn6GB76Z1MvkSz8MR/8vk6 NtIlIW6g6xX0b53VgCDa8wnycmaHpEun3cCH3s0Ojzrf6CAxj0DzS6dSW8wnrAvx/OrZ L6zQ== X-Gm-Message-State: AOJu0YwMcBc//Bt/HBwb3P5IMqrmEC7ZXmDxOIC1AHq9sa9CR3I7/1un HB6e3i0to79YWzEngm06awGxufOR0PrEpmO3/40mAFOQBK1l4FfE X-Google-Smtp-Source: AGHT+IHhPWkq0RBs+XazjMnZG6/DGzNBgG4rv2eIG5M3GCQKPgfKeM6Q4um5Md97S4pwRk5Fm+J6wA== X-Received: by 2002:a05:6602:2c8a:b0:835:45f9:c2ee with SMTP id ca18e2360f4ac-83b1c3de174mr443380939f.4.1730043241002; Sun, 27 Oct 2024 08:34:01 -0700 (PDT) Received: from localhost (207-191-210-45.dhcp.imoncommunications.net. [207.191.210.45]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4dc727b2997sm1208736173.174.2024.10.27.08.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Oct 2024 08:34:00 -0700 (PDT) From: Brandon Maier Date: Sun, 27 Oct 2024 10:33:55 -0500 Subject: [PATCH b4 3/6] b4: handle trailers with improper formatting Precedence: bulk X-Mailing-List: tools@linux.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241027-trailer-special-chars-v1-3-1bd180dba425@gmail.com> References: <20241027-trailer-special-chars-v1-0-1bd180dba425@gmail.com> In-Reply-To: <20241027-trailer-special-chars-v1-0-1bd180dba425@gmail.com> To: "Kernel.org Tools" Cc: Konstantin Ryabitsev , Brandon Maier X-Mailer: b4 0.15-dev A patch trailer with an improperly formatted email parses to an empty string. For example see the linked github issue, where a trailer's display name contains an unquoted comma. As patch trailers are often hand written this can happen frequently. Try to gracefully handle this case by checking if an email parses correctly, and if it doesn't fallback to displaying it verbatim. Fixes: https://github.com/mricon/b4/issues/50 Signed-off-by: Brandon Maier --- src/b4/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/b4/__init__.py b/src/b4/__init__.py index 5115a9cd9b8746f84eb104a2be69fe121724167e..cf112e3bce2911c78cff18aac267608f796957ab 100644 --- a/src/b4/__init__.py +++ b/src/b4/__init__.py @@ -1063,8 +1063,10 @@ def __init__(self, name: Optional[str] = None, value: Optional[str] = None, exti # Normalize the value with parsed data if self.addr[0]: self.value = f'{self.addr[0]} <{self.addr[1]}>' - else: + elif self.addr[1]: self.value = self.addr[1] + else: + self.type = 'unknown' else: self.type = 'unknown' self.lname = self.name.lower() From patchwork Sun Oct 27 15:33:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brandon Maier X-Patchwork-Id: 13852693 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBC861E50B for ; Sun, 27 Oct 2024 15:34:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730043244; cv=none; b=p7h+MvBNJNfd5xI1FvPNqNeV9U97m2DpIIWdTYESnL9z76j8HI01xRylCXVVlPDU2gTy/0XXXLUiESb25g2bq7gxj0oMIw4hafyGp3zUnobJ1qBNm25HsrV8cy+DWQKRGn9qOUFCEwJQlE9rXgFuTXEcSROVAqfZU6nMKlIMuio= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730043244; c=relaxed/simple; bh=K+l16sqaq3lJf73NknBv3zEhSAGS6mixircG+nne7Qw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V5Mrgdi2134f1harGZW0wFrhPCzr/MAbOdHzs/izsogd62YfmFRkqmMWy7QZUfFlWvpRqPsY9bhl033601ZK9vxE5wDtLE7vC7I0yJh3hK4A32jmTxqiRyct2cxmCzT+AaVeg4wDXjkGYPoXpcCfnLL7FBptvasGy3AEfxNYiTs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EQdH2BxU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EQdH2BxU" Received: by smtp.kernel.org (Postfix) id 6A51CC4CEC3; Sun, 27 Oct 2024 15:34:04 +0000 (UTC) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 7ACD0C4AF0B for ; Sun, 27 Oct 2024 15:34:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.kernel.org 7ACD0C4AF0B Authentication-Results: smtp.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-83aba65556cso146455939f.3 for ; Sun, 27 Oct 2024 08:34:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730043242; x=1730648042; darn=kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=D9CiP9VlwuLskIhfXi//tZDR9ko36YCjXLZj3JRThY8=; b=EQdH2BxUmgjYMRESTzgE8xU85GELnfcOyyzJmg5Qa+UuFhHZBVUuhGSQRZkSFTJoDj 2hSyBDsy5l6qHt/FeDsJI7uc/E6hMO9UE7/F80BEiaPYwo8PoUFLYv940TNCjuRotPoW 6mKFneWr6bRYpRCYz6mh/nFwSDW2KFK4MadT3kH+nd6J/TlI00L95L3guFGPnL+u3AN1 rIA/lETqkerNxz97V4WcJds5LeUW4NrF/6OPMELO8FHdOulXTFtMjFUoivAAdZtcq2So /gZsWEyWtw58+aSGD26wFkDsqvR6Tz50xyEYxeiia5d3W7mzRukiMncBM8CxXk+IkA+M BZ7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730043242; x=1730648042; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D9CiP9VlwuLskIhfXi//tZDR9ko36YCjXLZj3JRThY8=; b=Flqre7CxGXr4ig0XflIGmWVRk3QGM3dhLkxGtHPQMYOWXsvlJKep4Zcab1h6BrLyHs 8OBtNTgiZz+r5TGrDrZgfkhry6nP9dsjL/de3s9/Ho6Wk6Z3GmpSU7Oc54AZGRrBhKRo TFy+MpHdztH7CnUgXArw0JV5yOuKW6u5VXy810nG79gNDyFkx8joWRBl2D0b2ck5cxD2 Ab9nM7zuq7Nwm9zh1EvhDE/m+oIIlCRYpzHikA495Yk5FPDuvXcuf+L967E+edixYLDs szaKIHv4lGtpHNkChz3/2ssWFZw4HQaQIzBFJ2JHGeZ7quvxMwRjB0SzDjEWi2RMaZKF W7Aw== X-Gm-Message-State: AOJu0YzNvKEfsfr69OadrXufYFMgu+gaim1stPsfAXkdCdB3tKtJ6UVm A6yY35Row2wuEqW3J7sSAfF9tpDTEssd2lvzbmutIp7zLrC8bDzn/Pq3p5Ks X-Google-Smtp-Source: AGHT+IFpwGza/eu4BUrQUZe5ugAfFnYa2GlRm7v/YQ/+6w7GGT+zybZ2iH6tccWeTLmUPMxBYHEQ9Q== X-Received: by 2002:a05:6602:29d0:b0:83a:a746:68a6 with SMTP id ca18e2360f4ac-83b1c43e1a0mr529469639f.5.1730043242416; Sun, 27 Oct 2024 08:34:02 -0700 (PDT) Received: from localhost (207-191-210-45.dhcp.imoncommunications.net. [207.191.210.45]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-83b137f486dsm107413839f.24.2024.10.27.08.34.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Oct 2024 08:34:01 -0700 (PDT) From: Brandon Maier Date: Sun, 27 Oct 2024 10:33:56 -0500 Subject: [PATCH b4 4/6] src/tests: test for trailers with improper formatting Precedence: bulk X-Mailing-List: tools@linux.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241027-trailer-special-chars-v1-4-1bd180dba425@gmail.com> References: <20241027-trailer-special-chars-v1-0-1bd180dba425@gmail.com> In-Reply-To: <20241027-trailer-special-chars-v1-0-1bd180dba425@gmail.com> To: "Kernel.org Tools" Cc: Konstantin Ryabitsev , Brandon Maier X-Mailer: b4 0.15-dev Check that a trailer with an improperly formatted email address will still parse to something usable. Signed-off-by: Brandon Maier --- src/tests/samples/trailers-test-extinfo.txt | 1 + src/tests/test___init__.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tests/samples/trailers-test-extinfo.txt b/src/tests/samples/trailers-test-extinfo.txt index aa61e8d635923c2e2539b82c60f69b489ad7cee3..5417cdd87bfdf4ddb278e125a6dd04d2e86af141 100644 --- a/src/tests/samples/trailers-test-extinfo.txt +++ b/src/tests/samples/trailers-test-extinfo.txt @@ -4,6 +4,7 @@ Date: Tue, 30 Aug 2022 11:19:07 -0400 This is a simple trailer parsing test. +Reported-by: Some, One Reviewed-by: Bogus Bupkes [for the parts that are bogus] Fixes: abcdef01234567890 diff --git a/src/tests/test___init__.py b/src/tests/test___init__.py index 7fe43b0158460f06d0a2b52d2689d26e7ef7f840..85ccd190677daebc30b9987eb811d44a15dce79b 100644 --- a/src/tests/test___init__.py +++ b/src/tests/test___init__.py @@ -62,7 +62,8 @@ def test_save_git_am_mbox(sampledir, tmp_path, source, regex, flags, ismbox): ('utility', 'Link', 'https://msgid.link/some@msgid.here', None), ]), ('trailers-test-extinfo', - [('person', 'Reviewed-by', 'Bogus Bupkes ', '[for the parts that are bogus]'), + [('unknown', 'Reported-by', 'Some, One ', None), + ('person', 'Reviewed-by', 'Bogus Bupkes ', '[for the parts that are bogus]'), ('utility', 'Fixes', 'abcdef01234567890', None), ('person', 'Tested-by', 'Some Person ', ' [this person visually indented theirs]'), ('utility', 'Link', 'https://msgid.link/some@msgid.here', ' # initial submission'), From patchwork Sun Oct 27 15:33:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brandon Maier X-Patchwork-Id: 13852694 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 01B711E50B for ; Sun, 27 Oct 2024 15:34:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730043246; cv=none; b=Wr/ukFKr5bjMLm6GQ7BgoThCSNUP8lKHrjQeDpRFtGkb14Dcf6QpdZCkbr8roJOSaFJpZT+yuOhYEurDepTNHygIeKyuCjZhxCtzzVvNA3Tht5pUW9dIADOTkG0xEeRErGMx8hQXf0z1Nnjx4qEOEME/UkZ71aQXbR5nz7ZODVk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730043246; c=relaxed/simple; bh=GGJwFy34mHw7bB1vesQgsnGBfdaLZaHavNzZFf/l4h0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FG9gpyYbVBB3CJsViUexJdrx75JzNLYHmQEZ2BN1EF6rLfdnj4v/POkCh+9/ijMjd8XBYyOFN90cTTvrfi03BXTHTzT9J2u9wfEvpOSv8Qe/SI6zlldrv8eKi3mdu1ZzQLdQQl9dVroX1I/vBEQDR/hqwSY8M1KaeaULvhhggrg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WlwSiUwo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WlwSiUwo" Received: by smtp.kernel.org (Postfix) id 99D40C4CEC3; Sun, 27 Oct 2024 15:34:05 +0000 (UTC) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id B2DCEC4CEE6 for ; Sun, 27 Oct 2024 15:34:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.kernel.org B2DCEC4CEE6 Authentication-Results: smtp.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-8323b555a6aso192700839f.3 for ; Sun, 27 Oct 2024 08:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730043244; x=1730648044; darn=kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=nzybut7DKwbDAB6NU+v5yQnUqno+TdOhgfDSeNExLDA=; b=WlwSiUwoZY9SjdLh27HzTWT+vRb/eRTxSIpn2zOj4QOg3R1wFlecpy+uQpDh12F/+C js4k9wIp+5tyoAiQOCvvni827fMhVU+jY45Rr7ToYt6qkUvXwkvfJ6yjL0tM47Rz2fLz oUm0D3Zxc+zZF0VKq2y4R8YFWN3I/edqWHvfVP5/1AKoKcHRlEx4vMk6miZ/1xFl2Ei7 O4tcu8IV+RmJsh4AE4zObYdAwjUOdKAhxFqy0o9xGE2BsGSb0c9orzHF1RE7AliiZVDR GR4dzAor1sDTGEP1W584fOgoBYn8jvfK2dRMCVI6BSEgmvC0DkyOPTPntwNGs51XDzxv gt6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730043244; x=1730648044; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nzybut7DKwbDAB6NU+v5yQnUqno+TdOhgfDSeNExLDA=; b=aCvtFK2pa5XDIpwC1tja4eW23FjsE+7YIfQTg2crT+aV1EGFZO8weVSsTvjxZqaejw qwW48TfeX63akeQT6atMlQF/wUZqrW/lQq5GHwOBLL+6EQs6mvbEYBKM9pZPbpCTKBm4 j18+EbpGEKIFXvQGy2ywlPGjK0F2NcsNyN5UEAFj1gkuDZz6bjgNf/5Xih/W441dnp8W X/UaTEY/FStg3SaxI1cvtMchH1rnvH628Z5Y9T+8iQFeWW+kAYhGCHpF88ltGsC6UOmR 0PZIEvgbT8KdjYrEt1taRNnwVfqQLWj+1nQMsYAFPpj0ClPCviDODDVdi/Rx8eIFkDom e0CQ== X-Gm-Message-State: AOJu0YwCTni67qQieNlv15OdZ4IQ8sudYmRlBFQpnIOnX22uhy8dnmgZ XzTaJJe3Kkrgl/taIuGqDfUJ/XxNSqGYLyf3L3NQmhMNuFs83Ra0GhQfkR3A X-Google-Smtp-Source: AGHT+IFxi8u/ODY1vU9/eIoo8Ps64gXGl5un2w4Md+W93cmIcGk1izaSwh1hF7KGfJTs29eQgq0Dfw== X-Received: by 2002:a05:6e02:180a:b0:3a2:f7b1:2f89 with SMTP id e9e14a558f8ab-3a4ed2e91c6mr41973775ab.18.1730043243831; Sun, 27 Oct 2024 08:34:03 -0700 (PDT) Received: from localhost (207-191-210-45.dhcp.imoncommunications.net. [207.191.210.45]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3a4e6e56f24sm12260425ab.58.2024.10.27.08.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Oct 2024 08:34:03 -0700 (PDT) From: Brandon Maier Date: Sun, 27 Oct 2024 10:33:57 -0500 Subject: [PATCH b4 5/6] b4: handle trailers with special characters Precedence: bulk X-Mailing-List: tools@linux.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241027-trailer-special-chars-v1-5-1bd180dba425@gmail.com> References: <20241027-trailer-special-chars-v1-0-1bd180dba425@gmail.com> In-Reply-To: <20241027-trailer-special-chars-v1-0-1bd180dba425@gmail.com> To: "Kernel.org Tools" Cc: Konstantin Ryabitsev , Brandon Maier X-Mailer: b4 0.15-dev Parsing an email trailer with special characters breaks the formatting. For example this trailer. > Reviewed-by: "Doe, Jane" Will get parsed into this. > Reviewed-by: Doe, Jane This is because b4.LoreTrailer attempts to reformat the trailer using a naive string format. Instead use the Python standard library formataddr function which correctly handles special characters. Signed-off-by: Brandon Maier --- src/b4/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/b4/__init__.py b/src/b4/__init__.py index cf112e3bce2911c78cff18aac267608f796957ab..0785be8ffcef08fb5cd4c484a40e6fe856446cfe 100644 --- a/src/b4/__init__.py +++ b/src/b4/__init__.py @@ -1061,10 +1061,8 @@ def __init__(self, name: Optional[str] = None, value: Optional[str] = None, exti self.type = 'person' self.addr = email.utils.parseaddr(value) # Normalize the value with parsed data - if self.addr[0]: - self.value = f'{self.addr[0]} <{self.addr[1]}>' - elif self.addr[1]: - self.value = self.addr[1] + if self.addr[0] or self.addr[1]: + self.value = email.utils.formataddr(self.addr) else: self.type = 'unknown' else: From patchwork Sun Oct 27 15:33:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brandon Maier X-Patchwork-Id: 13852695 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4961B16BE3A for ; Sun, 27 Oct 2024 15:34:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730043247; cv=none; b=X+95prNV49xIbi9vW/Ud6ceVFboZJOqkhNF1EFlVr1m56nyqmmtjUctoRZaTuyvsbXOVdgf58oHtSjlARlfZnscknLLrJaimCi8CPIbPGKBG9vEWw8g4cjLx7aVbqZ2GMtheUiFLVm0HrHI4TG+KgTOLsNqN6KMbrkD+LOtFNl0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730043247; c=relaxed/simple; bh=mdjk1FASx8K9Fca5g8HKWaki5BgvEPiAlQXaqr3NPec=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=d3Nuje9k1XwbMzgfRX9RiKDOesYgp/NYJ/8jqPcH1sk7aBsCeaoozcw8LtT+P1YiyEBWat8VT4gok1ZlDaS3ibcxVHV9gePJtQk3FgfToJz4SgaUGMVgWwN0eKLSC5bDadtMoQx3zCFB4wqHlWdQ80mQw20uDaip/4BgFw78hMk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KBpVEcbZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KBpVEcbZ" Received: by smtp.kernel.org (Postfix) id 3E21DC4CEC3; Sun, 27 Oct 2024 15:34:07 +0000 (UTC) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 56FCBC4CEE9 for ; Sun, 27 Oct 2024 15:34:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.kernel.org 56FCBC4CEE9 Authentication-Results: smtp.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-83aac75fcceso125115139f.0 for ; Sun, 27 Oct 2024 08:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730043245; x=1730648045; darn=kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=vJrWISz0Xuvy0CmSlmkPNOkC1LDH7C1+EXPLkzYe154=; b=KBpVEcbZB8reLBr0/5t+O/NgW3kNDDPUXon57/2sFVJkm04x/Jqus66vA6FibDS4pA K6ds3TyjIPSfJPm9i7OjpMDSDmtdXBhNZcegyeebq2k9B/FKJrNx9HzqsxIg4VZTAWSk vaYVQ/cShnfvyHoj6jS+VN0FzJ5vzTrOhD7lwTsCtxhbSaDGBEO1EkbHupBeVcOORHZ3 4JFgdBh7mcMjqgTSVcdq39U7PmXmEJwF1zWBXbYkLkKHmAzbWfIdcN6PvoE6cUtNf3Kp SwyDnNvgHRYqqPwj5FYHpKUJYKIgT5R71kR1OWIHloiuhzSBqr+DoQ8j0k2jnWODo5NS t5rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730043245; x=1730648045; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vJrWISz0Xuvy0CmSlmkPNOkC1LDH7C1+EXPLkzYe154=; b=il+vP6nY4sljLXrI6GsOs4pcJZMAPl9lTN9Ae7F2ntZYoytFUUN+VpGwU8LhQo5OUt hT7f0n0uYCPVCvZKSRbUFczm62Rvqd17HwOnkBOvonKxR+lXsb3nNJpjryuF2hXoKZFI Uljmd7CaU+0YaKNcBlr6gvfNVpf37wUeql2bb8oa0ZAcCPgENG53Dh7QkTQhJSe/1Ewb 9lsaUGLTk5Ak6DBdNYs6dFDoOWTzSJlRs1rCYufrr47yhSXMJSUczxVnJtILcHYx+jxL XoHh/O9CGCaQzQjF4KAubhDAuRXwVcY7gVZTh/YPUGK75w42Rfb9eWHhVHDFKT4G9gID rxaw== X-Gm-Message-State: AOJu0YwrTdQN1EytWzTGF/AeBvmolTtw+qE5jTdj4pJPBHFOLLakTvll 8wdheHv2d7DtY07s+9LOQ8nEXG37ifOfmVdrtdHQmC7bbIFg++gq X-Google-Smtp-Source: AGHT+IGgYugro74+WxAFveOce2VdZos6EfUNMVZCaCdhZjsrzZC2+lmmdCmBPEBt9q+63nGWQ7P7Rg== X-Received: by 2002:a05:6e02:1fcb:b0:3a0:a311:6773 with SMTP id e9e14a558f8ab-3a4ed34fbcfmr42024325ab.21.1730043245217; Sun, 27 Oct 2024 08:34:05 -0700 (PDT) Received: from localhost (207-191-210-45.dhcp.imoncommunications.net. [207.191.210.45]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3a4e6e567e3sm12146635ab.70.2024.10.27.08.34.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Oct 2024 08:34:04 -0700 (PDT) From: Brandon Maier Date: Sun, 27 Oct 2024 10:33:58 -0500 Subject: [PATCH b4 6/6] src/tests: test for trailers with special characters Precedence: bulk X-Mailing-List: tools@linux.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241027-trailer-special-chars-v1-6-1bd180dba425@gmail.com> References: <20241027-trailer-special-chars-v1-0-1bd180dba425@gmail.com> In-Reply-To: <20241027-trailer-special-chars-v1-0-1bd180dba425@gmail.com> To: "Kernel.org Tools" Cc: Konstantin Ryabitsev , Brandon Maier X-Mailer: b4 0.15-dev Test that email trailers with special characters are parsed correctly. Signed-off-by: Brandon Maier --- src/tests/samples/trailers-test-simple.txt | 1 + src/tests/test___init__.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tests/samples/trailers-test-simple.txt b/src/tests/samples/trailers-test-simple.txt index da64caff8dfaa0cbc630c8ae3515f4508cfd0764..a82416354012d3c32f99b39d1918ac343f2b66cc 100644 --- a/src/tests/samples/trailers-test-simple.txt +++ b/src/tests/samples/trailers-test-simple.txt @@ -4,6 +4,7 @@ Date: Tue, 30 Aug 2022 11:19:07 -0400 This is a simple trailer parsing test. +Reported-by: "Doe, Jane" Reviewed-by: Bogus Bupkes Fixes: abcdef01234567890 Link: https://msgid.link/some@msgid.here diff --git a/src/tests/test___init__.py b/src/tests/test___init__.py index 85ccd190677daebc30b9987eb811d44a15dce79b..a4637b9c797367da462f062511fdf4e018a5b81e 100644 --- a/src/tests/test___init__.py +++ b/src/tests/test___init__.py @@ -57,7 +57,8 @@ def test_save_git_am_mbox(sampledir, tmp_path, source, regex, flags, ismbox): @pytest.mark.parametrize('source,expected', [ ('trailers-test-simple', - [('person', 'Reviewed-by', 'Bogus Bupkes ', None), + [('person', 'Reported-by', '"Doe, Jane" ', None), + ('person', 'Reviewed-by', 'Bogus Bupkes ', None), ('utility', 'Fixes', 'abcdef01234567890', None), ('utility', 'Link', 'https://msgid.link/some@msgid.here', None), ]),