From nobody Fri Apr 26 14:06:25 2024 Delivered-To: importer2@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1663573072; cv=none; d=zohomail.com; s=zohoarc; b=FWitFgx0L07fmR9qTVCnHkcbb7xHzpjyTg7TPjR4q16b29ifvQnsaolr0MA+2+3CDfWuHHcmJh8/VRG8jBHeP1kq7uSoNr3n6WYCmcI4+PRdGKaQ6W2GL7+nNot1tANKjNOdCUl8yJXd7GQlrEOkx+XAhIgIwXsUwjd/Y7gPsRE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663573072; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=z/W7j+TGMJStZXbvxuWN4X/YUmY6oDc1ZNUJQQ43ivc=; b=YCxLkOH1PCA5STHrTalk0XnWA1DbzqNORT+D+NRGgVaO13Fn5SkjX7h0JzPwZFodgpYNR0QwdAfV6AlMMys3WCAZljM+8wLvsUU+qw0j0bnQIyEcci1CGIRjZoWpBIY+3h/cVMoSMpIH8d0mjlUhtYWCrfLUaIzovRowL4nm7xc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1663573072300234.54724760135264; Mon, 19 Sep 2022 00:37:52 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-649-qoVmOY0uPFe6c3uiiu6spg-1; Mon, 19 Sep 2022 03:37:50 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 949441C09043; Mon, 19 Sep 2022 07:37:49 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8D15D492B04; Mon, 19 Sep 2022 07:37:49 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3AD851946594; Mon, 19 Sep 2022 07:37:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AF9F81946586 for ; Mon, 19 Sep 2022 07:37:48 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5A86C1121315; Mon, 19 Sep 2022 07:37:48 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 533221121314 for ; Mon, 19 Sep 2022 07:37:48 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3455A1C09041 for ; Mon, 19 Sep 2022 07:37:48 +0000 (UTC) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-368-4DpjHh4vM0KLl1OdZ8KFKg-1; Mon, 19 Sep 2022 03:37:46 -0400 Received: by mail-wr1-f72.google.com with SMTP id h20-20020adfaa94000000b0022af8c26b72so411349wrc.7 for ; Mon, 19 Sep 2022 00:37:46 -0700 (PDT) Received: from goa-sendmail ([93.56.164.28]) by smtp.gmail.com with ESMTPSA id w14-20020adf8bce000000b0022ac119fcc5sm13350586wra.60.2022.09.19.00.37.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 00:37:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663573071; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=z/W7j+TGMJStZXbvxuWN4X/YUmY6oDc1ZNUJQQ43ivc=; b=fqgknQ3PKpu62M/OAJx5kTZ5CMnWLuSdrTIxcBz0LQQ+Aok+p/7kNvwIlO1NAt9ndkXrvU tHVv6C+/zck285oZPLK/7m5sORMDGMjxraDnaXiPSCGL/2J8II/OgAlIC+ktRBPyOfqaqZ La2jY/4PoNf7vOgOQKqFRrAlMwEeM7U= X-MC-Unique: qoVmOY0uPFe6c3uiiu6spg-1 X-Original-To: patchew-devel@listman.corp.redhat.com X-MC-Unique: 4DpjHh4vM0KLl1OdZ8KFKg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date; bh=5t166dazylQyro6z+U2gjhGcaqUOG4NdKB8U2x/mCdY=; b=Wp1UXzxgbB4URzFUhUdcs0qt6h2WiJqNC50CsrKn0ASecLLOFA9FZUbBXDQEr/jdcK 513OVibb94uzP/r6D4io9TkPPBnTxzpZGu5GQwhXl4EaR5IIYlwiv+N0PfAXP7NidzSa /QIT/Xmnywg+gVuDF2Ln6RUgH9oE4XhG/07IY1XIAEqWluKxv0wJAIcy5RgvgcXykAn0 nfv3477BHzzfmYCh49sOXFguhNX+qGhkCVhuHPEEPp/0h6nNCxk+Ud7QX9tLtZP2xyvw axcGTJVUsC4R27ce+SdLiXy6BFmg6WSaPHmlqPPGCSnvXdtt+a6C7KAwKqS430vVSLTS uOOA== X-Gm-Message-State: ACrzQf2nwWAerF8jKkqg0Zjrc+7RShVMlBN1dZ2L9Rd+E5aPkls6wFm1 j41IWV+gupmJ6n5pBFDeO7KUCfEcrd1CVBmOyB21j+lHgE34Y+ya2r30aNrCwxX9nHH1ZF8s8sj sMQ2uc998OdrdGoda1Xm2TLP+KkIdwS0vEUkHmgH1OXaANkuohup/DPm1CfiLRyaFM7zFFfc2xA == X-Received: by 2002:adf:dd4b:0:b0:22a:d8d2:98a6 with SMTP id u11-20020adfdd4b000000b0022ad8d298a6mr9827546wrm.178.1663573065104; Mon, 19 Sep 2022 00:37:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4IoKNrOxI6GWqBJHP4efDw83sHjXx3X+ztKCp3ZlngJ8gRZjWtZjghRd5R4W8K4Vw80M94ZA== X-Received: by 2002:adf:dd4b:0:b0:22a:d8d2:98a6 with SMTP id u11-20020adfdd4b000000b0022ad8d298a6mr9827528wrm.178.1663573064775; Mon, 19 Sep 2022 00:37:44 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Mon, 19 Sep 2022 09:37:43 +0200 Message-Id: <20220919073743.8625-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Subject: [Patchew-devel] [PATCH] api: handle "[PATCH 3/4/5]" in the subject line X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchew-devel-bounces@redhat.com Sender: "Patchew-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1663573072461100001 Content-Type: text/plain; charset="utf-8" Avoids errors like Traceback (most recent call last): ... File "/opt/patchew/www/views.py", line 53, in prepare_message m.num_patches =3D m.get_num_patches() File "/opt/patchew/api/models.py", line 806, in get_num_patches self.refresh_num_patches() File "/opt/patchew/api/models.py", line 787, in refresh_num_patches c, n =3D self.get_num() File "/opt/patchew/api/models.py", line 737, in get_num n, m =3D tag.split("/") ValueError: too many values to unpack (expected 2) Signed-off-by: Paolo Bonzini --- api/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/models.py b/api/models.py index c4f10da..cd0285d 100644 --- a/api/models.py +++ b/api/models.py @@ -734,7 +734,9 @@ class Message(models.Model): cur, total =3D 1, 1 for tag in self.prefixes: if "/" in tag: - n, m =3D tag.split("/") + # Adding the slash at the end ensures that both "3/4" and = "3/4/5" + # are parsed correctly. + n, m, _ =3D (tag + "/").split("/", maxsplit=3D2) try: cur, total =3D int(n), int(m) break --=20 2.37.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://listman.redhat.com/mailman/listinfo/patchew-devel