From: Jonathan Corbet <corbet@lwn.net>
To: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Jani Nikula <jani.nikula@intel.com>,
linux-doc@vger.kernel.org,
Vegard Nossum <vegard.nossum@oracle.com>,
Justin Forbes <jforbes@fedoraproject.org>,
Salvatore Bonaccorso <carnil@debian.org>,
stable@vger.kernel.org
Subject: Re: [PATCH 1/8] docs: kernel_feat.py: fix build error for missing files
Date: Tue, 06 Feb 2024 15:53:33 -0700 [thread overview]
Message-ID: <8734u5p5le.fsf@meer.lwn.net> (raw)
In-Reply-To: <20240205175133.774271-2-vegard.nossum@oracle.com>
Vegard Nossum <vegard.nossum@oracle.com> writes:
> If the directory passed to the '.. kernel-feat::' directive does not
> exist or the get_feat.pl script does not find any files to extract
> features from, Sphinx will report the following error:
>
> Sphinx parallel build error:
> UnboundLocalError: local variable 'fname' referenced before assignment
> make[2]: *** [Documentation/Makefile:102: htmldocs] Error 2
>
> This is due to how I changed the script in c48a7c44a1d0 ("docs:
> kernel_feat.py: fix potential command injection"). Before that, the
> filename passed along to self.nestedParse() in this case was weirdly
> just the whole get_feat.pl invocation.
>
> We can fix it by doing what kernel_abi.py does -- just pass
> self.arguments[0] as 'fname'.
>
> Fixes: c48a7c44a1d0 ("docs: kernel_feat.py: fix potential command injection")
> Cc: Justin Forbes <jforbes@fedoraproject.org>
> Cc: Salvatore Bonaccorso <carnil@debian.org>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: stable@vger.kernel.org
> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
> ---
> Documentation/sphinx/kernel_feat.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/sphinx/kernel_feat.py b/Documentation/sphinx/kernel_feat.py
> index b9df61eb4501..03ace5f01b5c 100644
> --- a/Documentation/sphinx/kernel_feat.py
> +++ b/Documentation/sphinx/kernel_feat.py
> @@ -109,7 +109,7 @@ class KernelFeat(Directive):
> else:
> out_lines += line + "\n"
>
> - nodeList = self.nestedParse(out_lines, fname)
> + nodeList = self.nestedParse(out_lines, self.arguments[0])
> return nodeList
So I can certainly track this through to 6.8, but I feel like I'm
missing something:
- If we have never seen a ".. FILE" line, then (as the changelog notes)
no files were found to extract feature information from. In that
case, why make the self.nestedParse() call at all? Why not just
return rather than making a useless call with a random name?
What am I overlooking?
Thanks,
jon
next prev parent reply other threads:[~2024-02-06 22:53 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-05 17:51 [PATCH 0/8] Sphinx extension fix + logging/warning cleanups Vegard Nossum
2024-02-05 17:51 ` [PATCH 1/8] docs: kernel_feat.py: fix build error for missing files Vegard Nossum
2024-02-06 4:30 ` Mauro Carvalho Chehab
2024-02-06 6:03 ` Salvatore Bonaccorso
2024-02-06 22:53 ` Jonathan Corbet [this message]
2024-02-07 2:57 ` Vegard Nossum
2024-02-07 14:42 ` Jonathan Corbet
2024-02-07 15:02 ` Vegard Nossum
2024-02-08 18:06 ` Jonathan Corbet
2024-02-05 17:51 ` [PATCH 2/8] docs: kernel_{abi,feat}.py: use doc.current_source Vegard Nossum
2024-02-06 8:49 ` Jani Nikula
2024-02-06 13:04 ` Vegard Nossum
2024-02-05 17:51 ` [PATCH 3/8] doc: kernel_abi.py: convert to sphinx.util.logging Vegard Nossum
2024-02-06 4:36 ` Mauro Carvalho Chehab
2024-02-05 17:51 ` [PATCH 4/8] doc: kernel_feat.py: " Vegard Nossum
2024-02-06 4:42 ` Mauro Carvalho Chehab
2024-02-06 12:38 ` Vegard Nossum
2024-02-05 17:51 ` [PATCH 5/8] doc: kerneldoc.py: " Vegard Nossum
2024-02-06 4:43 ` Mauro Carvalho Chehab
2024-02-05 17:51 ` [PATCH 6/8] doc: kfigure.py: " Vegard Nossum
2024-02-06 3:04 ` Akira Yokosawa
2024-02-06 12:40 ` Vegard Nossum
2024-02-06 4:49 ` Mauro Carvalho Chehab
2024-02-06 8:57 ` Jani Nikula
2024-02-06 13:12 ` Vegard Nossum
2024-02-06 14:00 ` Vegard Nossum
2024-02-06 16:08 ` Mauro Carvalho Chehab
2024-02-06 18:27 ` Jani Nikula
2024-02-05 17:51 ` [PATCH 7/8] doc: remove kernellog.py Vegard Nossum
2024-02-06 4:50 ` Mauro Carvalho Chehab
2024-02-05 17:51 ` [PATCH 8/8] doc: kernel_{abi,feat}.py: warn about missing directory Vegard Nossum
2024-02-06 4:53 ` Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8734u5p5le.fsf@meer.lwn.net \
--to=corbet@lwn.net \
--cc=carnil@debian.org \
--cc=jani.nikula@intel.com \
--cc=jforbes@fedoraproject.org \
--cc=linux-doc@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=stable@vger.kernel.org \
--cc=vegard.nossum@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).