From patchwork Sat Aug 29 00:10:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 96752 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 660CCC61DD9 for ; Sat, 29 Aug 2026 00:11:22 +0000 (UTC) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.277.1787962275978980098 for ; Fri, 28 Aug 2026 17:11:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=gPwsWhwL; spf=pass (domain: gmail.com, ip: 209.85.216.52, mailfrom: raj.khem@gmail.com) Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-38e58034d05so1459775a91.2 for ; Fri, 28 Aug 2026 17:11:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787962275; x=1788567075; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=kN9/9fYtbkL3YWd2WzneNt9kkFu4IUYfkeSlnURzpOc=; b=gPwsWhwLa8zN0+gyLGy8GAH43mrxR9NYQHA4rsyRZRMvGZUuK+qNeNGXlMsrjvuJpX 1TgSkE3MaDcZVjpJhmZOd6CmSOzfc7Jeq/sVI4rHaqb2tSc/D0nk8QX/L9b4FZOOVWFk zxbnOmdAbRfFeUShs+fN6jhIcAY86Cmo+TAe33jNlkY0U+LjtcxL17dchRqwN90atxLh 2tWtTNJr9roz4bjt6HIvU7IQomv08B+k1LoonAN1oM4cdLBb9kcEY0T615fqBc+PtBr3 v05JRF7FaQXC8cqBk5Li9K1WGF3Tpm1uxwuEy8SVqYmGZEYrCFlsfPEhbRj8GB3Z+2Fs ESpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787962275; x=1788567075; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=kN9/9fYtbkL3YWd2WzneNt9kkFu4IUYfkeSlnURzpOc=; b=JUsmY/PEgHfRhTdv5qYbZi9vuqnWH9C9wEXtTX87e6c01XXfCuzfSQ/r3uSTxFbDfJ UxGH2TJ6X8db6EuoBY/tkD9LgaS9M9loh8sKxPSytT2n6luGpdddvp+4QP8DBufISd/s 4DGBMYJ5MA9gJbIKGrm7E2edo94TSvoCXzMobb3KJhJN4GZvJCODXAM+WOvP52Q9Q8KG EYed1y259/C1HRRdBuT5g5chNH2wEkw49rMkDP0kr0PgWLbWE7sRZYC1/z69s+Q2f6Xm RAbp87QNKINtcpVWNaMozeWW6PnBqftVSON/eqr81OFvK5u74mE61C+cw6J54D+6jXso trlg== X-Gm-Message-State: AFuF++niL7ftLFu5bgasyUZEO8vOg/qcNQA+/i5HtdUew5JgEnMEtaqg iT+tnz1icSbzhGY8bX27DeI67RUD3jQUz0ftecvYhku6GXR2GJ4LzmjZu/NAEg== X-Gm-Gg: AYBFou0uF4H5LNA0p3Q0BwyvXEVoAFUAeDvbzeKPphzpy7LDQ/xJxp9tscBLa960f5O IUmDfA9D0jBlOiJwrGvuehbaOoUeDJTr3WiDXHy4M1EkTdz/Ve/+QFFtoRScbnbw0Rr5ZvyOvvb xHl/88yReIhWDtkmPeOBkE9yTcDcT0OsPfRuEuxJl4QgcwoSYv6RQPDMNF1/8jSyX7q9pSFXP9t XCGEGbaSqnjxbrJEHZkuD81/eU2aDE++BZ2XtZrSmy4Ey4VTHsNrV9uB5gGd1jnLSROsEfggc77 KSBnyPygArhAypLfaocRRy0d6M//4K15ZXu4f8YYCD94kFxcwvVrkzvGl77GY/M4oXfBzPTpEs1 8E9KTmBTUaa8Ca9J8aZloRgGxnI1BZT10ZvQnSZ4EDey8cHG7xz/yAsDY3CErrs/EQI2+8DY/CW EzGIa7t3R/IgHgXy1UNA4tIAGVdPpPXowdoJ1fQDVhOfQQWaZPYd6cw/TLYOgutkRejvo/EfMT3 vCwCSlnjUIGv6KwohKQeoDRIh40BHrTl/zo21x0FRq6hwt68rkSfQHNbxoE8GUh4y7PGcVrPdlU yCsV+CRiyhpikMNrZq9qTmATYmfj4Y0knOnM/qjsFkJQ+uZb1gAyJoyILcVXjXXuCDx/rcKirvK 1KY6DitvGlQzgIlN8II38nLfSqecpUamN7rQhm8cK6dvf4FyJzCp0gwp9 X-Received: by 2002:a17:90b:3c47:b0:38d:f5bb:e0f4 with SMTP id 98e67ed59e1d1-396d0e27e11mr20413008a91.1.1787962275147; Fri, 28 Aug 2026 17:11:15 -0700 (PDT) Received: from apollo.localdomain ([208.95.233.74]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-142e0d38207sm9236668c88.5.2026.08.28.17.11.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2026 17:11:14 -0700 (PDT) From: Khem Raj X-Google-Original-From: Khem Raj To: openembedded-devel@lists.openembedded.org Cc: Khem Raj Subject: [meta-python][PATCH 03/16] python3-flask: fix ptest failures from pytest/werkzeug version skew Date: Fri, 28 Aug 2026 17:10:54 -0700 Message-ID: <20260829001108.559544-3-khem.raj@oss.qualcomm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260829001108.559544-1-khem.raj@oss.qualcomm.com> References: <20260829001108.559544-1-khem.raj@oss.qualcomm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sat, 29 Aug 2026 00:11:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/129562 From: Khem Raj tests/test_cli.py and tests/conftest.py use pytest's monkeypatch "not set" sentinel, renamed from lowercase 'notset' to 'NOTSET' in pytest 9.1; rewrite the references in the installed ptest copy. werkzeug 3.1.x's get_host() no longer raises SecurityError for a Host header with invalid/non-printable characters when no trusted_hosts is configured (flask's default) - it silently returns "" and the request routes to a 404 instead of the 400 test_bad_environ_raises_bad_request expects against older werkzeug. Version-skew, not a flask bug; skip the test. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj --- .../python/python3-flask_3.1.3.bb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/meta-python/recipes-devtools/python/python3-flask_3.1.3.bb b/meta-python/recipes-devtools/python/python3-flask_3.1.3.bb index 1e3890e7f5..5b87d0d26a 100644 --- a/meta-python/recipes-devtools/python/python3-flask_3.1.3.bb +++ b/meta-python/recipes-devtools/python/python3-flask_3.1.3.bb @@ -26,3 +26,19 @@ RDEPENDS:${PN} = " \ RDEPENDS:${PN}-ptest += "\ python3-asgiref \ " + +# tests/test_cli.py and tests/conftest.py use pytest's monkeypatch "not set" +# sentinel, renamed from lowercase 'notset' to 'NOTSET' in pytest 9.1 +do_install_ptest:append() { + sed -i 's/from _pytest.monkeypatch import notset/from _pytest.monkeypatch import NOTSET as notset/' \ + ${D}${PTEST_PATH}/tests/test_cli.py + sed -i 's/monkeypatch\.notset/monkeypatch.NOTSET/g' \ + ${D}${PTEST_PATH}/tests/conftest.py + # werkzeug 3.1.x get_host() no longer raises SecurityError for a Host + # header with invalid/non-printable characters when no trusted_hosts is + # configured (flask's default) - it silently returns "" and the request + # routes to a 404 instead of the 400 this test was written to expect + # against older werkzeug. Version-skew, not a flask bug. + sed -i '/^def test_bad_environ_raises_bad_request/i @pytest.mark.skip(reason="werkzeug 3.1.x get_host returns empty string for invalid Host chars -> 404 not 400")' \ + ${D}${PTEST_PATH}/tests/test_reqctx.py +}