Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp33722rdb; Mon, 14 Aug 2023 08:44:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEncNILAkMLl89WkhrllaXc7Gb4MRncxgFX44DE90lxUIFQa3p/Ub/JV635VGu/qezzhJid X-Received: by 2002:a17:902:7405:b0:1b2:1a79:147d with SMTP id g5-20020a170902740500b001b21a79147dmr10616790pll.2.1692027886332; Mon, 14 Aug 2023 08:44:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692027886; cv=none; d=google.com; s=arc-20160816; b=MscqvapX1i3U1tH6J/X0XIp2WdFdhv+40ruUCAj3nq4Qpqrrax+dpg/3V3zfIvnnkM YHgx+/dqLIR8Q6Bfs+K5qw4dcaxiEdoJkALNBrtM7WdnVtBF5QQGljA5til2QsJ6U7E+ x1FOAZg84Mx4P8r8WMkU14MlDeZsvv+l5uhsfy/48pIn/9Nd3u17NqM/uF6tWlUvlQf0 04gUIiuPw9QyqGFR4UK8AXmGfePoomrE7LOI6jFbZCjUiXzJ2zP96z05rhi1IPQdaIzE DX479kYsS1S2OMoPkBwqbhOw/M2cnaNbQd+CgBe6Qgrh4d4WkyT1RU5O5+MaESW61j9w 468A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature:dkim-filter; bh=TTfv8kyCp+lhTXNlRfFTNBLGGFbAUEW/7RUG2jpU/lA=; fh=mhn8+oqsTGKA8lKcJj19ig+xAWyKuUxbdR68YlWj7Iw=; b=e96xuGDRw7v2a4Tr/oSSXD0xDOK+eSHbYycKLGFtuyRms3qbTkYj++vcz/ix+ptUKc Ik0E2Yp5jo6S0iU721I284ozWvusjWUoQRaVgfJunKCr+QTwPKwKqk61zNujyJdOGdPM KPHRu2bynj8A7IU2450CUquIfYM/wp/HGYYDcRpkvfuoMIMOkMsVGb/YLAl7qYJyav1U bc1raix1H/RP7L8UCI/tVyzRcOEu6yCZzurUm3CVuUyrX27H4OCH6XjN1lmheVWl2A7q 5HneYJykhwjppMEpLd+QXkwExSQ/CTI6KHytHhagSGTsnSOKbUk6M6YDCi2iEgDcy6qD VwFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lwn.net header.s=20201203 header.b=jzVnUWEe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i189-20020a6387c6000000b0056467852fbesi7969694pge.779.2023.08.14.08.44.34; Mon, 14 Aug 2023 08:44:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lwn.net header.s=20201203 header.b=jzVnUWEe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231404AbjHNNgX (ORCPT + 99 others); Mon, 14 Aug 2023 09:36:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231666AbjHNNgM (ORCPT ); Mon, 14 Aug 2023 09:36:12 -0400 Received: from ms.lwn.net (ms.lwn.net [45.79.88.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7D9010C6; Mon, 14 Aug 2023 06:35:58 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:281:8300:73::5f6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ms.lwn.net (Postfix) with ESMTPSA id 383902DC; Mon, 14 Aug 2023 13:35:58 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 ms.lwn.net 383902DC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lwn.net; s=20201203; t=1692020158; bh=TTfv8kyCp+lhTXNlRfFTNBLGGFbAUEW/7RUG2jpU/lA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=jzVnUWEeH0OBts9ZGWMVY16Ee4OZCCdCOllpzYuGjxL2jP5/bu/ssntiDH3y3nvBD O3PU2D2PG03RjZqrNKvt0hHAsxKlebT0FKBtNE/5Einys6RC8fL2/mhuV+4ZsRS4Fi a1tBF3Z1jeSC7fr59WzGvWbWK1SuGttXXinXdOHWPlQWz4sI56/PIeLxA0Y4CjzO+2 ipWPJPL3ZqW9/aCH+MxhAoy+aOiUadLGpDgZCdmtKaZdyBmbaivIebZ0tAxxcYZFZ3 E0jRRBCVYi/gt/OkTIVEJjmnRO4NkzwPhEVjRXQMcDpQP8jdRna6CNq6uqF2JPhGW6 uiKiS9d0+HSXg== From: Jonathan Corbet To: Benjamin Gray , linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, linux-doc@vger.kernel.org, bpf@vger.kernel.org, linux-pm@vger.kernel.org Cc: abbotti@mev.co.uk, hsweeten@visionengravers.com, jan.kiszka@siemens.com, kbingham@kernel.org, mykolal@fb.com, Benjamin Gray Subject: Re: [PATCH 2/8] Documentation/sphinx: fix Python string escapes In-Reply-To: <20230814060704.79655-3-bgray@linux.ibm.com> References: <20230814060704.79655-1-bgray@linux.ibm.com> <20230814060704.79655-3-bgray@linux.ibm.com> Date: Mon, 14 Aug 2023 07:35:57 -0600 Message-ID: <87jztxwxtu.fsf@meer.lwn.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Benjamin Gray writes: > Python 3.6 introduced a DeprecationWarning for invalid escape sequences. > This is upgraded to a SyntaxWarning in Python 3.12, and will eventually > be a syntax error. > > Fix these now to get ahead of it before it's an error. > > Signed-off-by: Benjamin Gray > --- > Documentation/sphinx/cdomain.py | 2 +- > Documentation/sphinx/kernel_abi.py | 2 +- > Documentation/sphinx/kernel_feat.py | 2 +- > Documentation/sphinx/kerneldoc.py | 2 +- > Documentation/sphinx/maintainers_include.py | 8 ++++---- > 5 files changed, 8 insertions(+), 8 deletions(-) So I am the maintainer for this stuff...is there a reason you didn't copy me on this work? > diff --git a/Documentation/sphinx/cdomain.py b/Documentation/sphinx/cdomain.py > index ca8ac9e59ded..dbdc74bd0772 100644 > --- a/Documentation/sphinx/cdomain.py > +++ b/Documentation/sphinx/cdomain.py > @@ -93,7 +93,7 @@ def markup_ctype_refs(match): > # > RE_expr = re.compile(r':c:(expr|texpr):`([^\`]+)`') > def markup_c_expr(match): > - return '\ ``' + match.group(2) + '``\ ' > + return '\\ ``' + match.group(2) + '``\\ ' I have to wonder about this one; I doubt the intent was to insert a literal backslash. I have to fire up my ancient build environment to even try this, but even if it's right... > # > # Parse Sphinx 3.x C markups, replacing them by backward-compatible ones > diff --git a/Documentation/sphinx/kernel_abi.py b/Documentation/sphinx/kernel_abi.py > index b5feb5b1d905..b9f026f016fd 100644 > --- a/Documentation/sphinx/kernel_abi.py > +++ b/Documentation/sphinx/kernel_abi.py > @@ -138,7 +138,7 @@ class KernelCmd(Directive): > code_block += "\n " + l > lines = code_block + "\n\n" > > - line_regex = re.compile("^\.\. LINENO (\S+)\#([0-9]+)$") > + line_regex = re.compile("^\\.\\. LINENO (\\S+)\\#([0-9]+)$") All of these really just want to be raw strings - a much more minimal fix that makes the result quite a bit more readable: line_regex = re.compile(r"^\.\. LINENO (\S+)\#([0-9]+)$") ^ | ---------------------------+ That, I think, is how these should be fixed. Thanks, jon