From patchwork Mon Jan 22 11:01:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 19442 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 8CE2DBDB1C for ; Mon, 22 Jan 2024 11:01:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3DE0F61D30; Mon, 22 Jan 2024 12:01:23 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="OWu4pKrL"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 24CE561D30 for ; Mon, 22 Jan 2024 12:01:22 +0100 (CET) Received: from pyrite.hamster-moth.ts.net (h175-177-049-156.catv02.itscom.jp [175.177.49.156]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 068E8FA2; Mon, 22 Jan 2024 12:00:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1705921209; bh=gInpoAr+YGh3bcOLIfCR5BBvPjhIqvtRKQVKdzfi5Vo=; h=From:To:Cc:Subject:Date:From; b=OWu4pKrLbJWp8DbIVO/BXqPHo81ak6zExEJwfpFvFyei3aAsQLbQiVCphMC0tnoRB gFHZS3UfX9QVAoW1WqyCJOlrqep+no+YHFB7UV2O/yDOzbqwnsbzprQor/jO2F5L8z LYLdNpgGsXZXufbohGtcXIBi5SmQZBsmfwCAPY1A= From: Paul Elder To: libcamera-devel@lists.libcamera.org Subject: [PATCH] utils: ipc: extract-docs: Fix escape characters in regex Date: Mon, 22 Jan 2024 20:01:04 +0900 Message-Id: <20240122110104.3206863-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Newer versions of python now generate a SyntaxWarning (SyntaxError in the future [1]) for invalid escape sequences. Fix this, as there were invalid escape sequences in the regexes: "libcamera/utils/ipc/./extract-docs.py:13: SyntaxWarning: invalid escape sequence '\/'" [1] https://docs.python.org/3.12/library/re.html Reported-by: Nicolas Dufresne Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Tested-by: Nicolas Dufresne --- I'm not actually able to reproduce the warning in the first place, but from my understanding this should fix the problem. Nicolas, could you confirm this please? --- utils/ipc/extract-docs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/ipc/extract-docs.py b/utils/ipc/extract-docs.py index 8f7fff9ff..c2050c998 100755 --- a/utils/ipc/extract-docs.py +++ b/utils/ipc/extract-docs.py @@ -10,9 +10,9 @@ import argparse import re import sys -regex_block_start = re.compile('^\/\*\*$') -regex_block_end = re.compile('^ \*\/$') -regex_spdx = re.compile('^\/\* SPDX-License-Identifier: .* \*\/$') +regex_block_start = re.compile(r'^/\*\*$') +regex_block_end = re.compile(r'^ \*/$') +regex_spdx = re.compile(r'^/\* SPDX-License-Identifier: .* \*/$') def main(argv):