On 06/02/2024 23:53, Jonathan Corbet wrote:
Vegard Nossum <vegard.nossum@xxxxxxxxxx> writes:
@@ -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?
Even if we skip the call in the error/empty case, we still need to pass
a sensible value here in the other cases -- this value is the file that
will be attributed by Sphinx if there is e.g. a reST syntax error in any
of the feature files. 'fname' here is basically the last file that
happened to be read by get_feat.pl, which is more misleading than
self.arguments[0] IMHO.
So basically: Yes, we could skip the call entirely, but we'd still want
to make the above change as well; skipping it doesn't change that.
Maybe we should just change it to doc.current_source directly -- my
rationale for splitting it up into two patches was that we would have
one patch bringing it sort of back to where we were before (having it at
least not error out and still be the obvious/minimal fix that can get
backported to stable) and then a patch actually improving on that (the
next patch in the series).
Does that make sense?
Vegard