New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux Kernel: TypeError: object of type 'PosixPath' has no len #11629
Comments
Are you able to run with the A |
-T only catches the len error. The + warning isn't caught. I can fix and compile with this patch but I don't think it's the right solution. I suspect that there's some places you missed and return a PosixPath rather than str(PosixPath), so rarely used that regular bug checks didn't catch them. diff -ru a/Documentation/sphinx/kerneldoc.py b/Documentation/sphinx/kerneldoc.py
--- a/Documentation/sphinx/kerneldoc.py 2023-08-16 12:21:03.000000000 -0400
+++ b/Documentation/sphinx/kerneldoc.py 2023-08-22 10:54:28.646583489 -0400
@@ -148,7 +148,7 @@
lineoffset = int(match.group(1)) - 1
# we must eat our comments since the upset the markup
else:
- doc = env.srcdir + "/" + env.docname + ":" + str(self.lineno)
+ doc = str(env.srcdir) + "/" + str(env.docname) + ":" + str(self.lineno)
result.append(line, doc + ": " + filename, lineoffset)
lineoffset += 1
diff -ru a/Documentation/sphinx/kfigure.py b/Documentation/sphinx/kfigure.py
--- a/Documentation/sphinx/kfigure.py 2023-08-16 12:21:03.000000000 -0400
+++ b/Documentation/sphinx/kfigure.py 2023-08-22 10:54:07.629742553 -0400
@@ -266,7 +266,7 @@
if dst_fname:
# the builder needs not to copy one more time, so pop it if exists.
translator.builder.images.pop(img_node['uri'], None)
- _name = dst_fname[len(translator.builder.outdir) + 1:]
+ _name = dst_fname[len(str(translator.builder.outdir)) + 1:]
if isNewer(dst_fname, src_fname):
kernellog.verbose(app, |
Forward port of change suggested by @severach in Sphinx github issue #11629 [1]. Link: [1] sphinx-doc/sphinx#11629
Forward port of change suggested by @severach in Sphinx github issue #11629 [1]. Link: [1] sphinx-doc/sphinx#11629
Please test with Sphinx 7.2.3, which should fix this issue. A |
Duplicates #11605 |
The kernel compiles with or without my patch on Sphinx 7.2.3 and 7.1.2. The patch eliminates the warnings. Would you say that my patch is good to keep compiles working for current versions and on through the deprecation in 8.x? |
Yes, that'll work for the forseeable (as it unconditionally coerces I'd consider the below, though, assuming the Kernel's documentation requires Python 3.6 or later: diff -ru a/Documentation/sphinx/kerneldoc.py b/Documentation/sphinx/kerneldoc.py
--- a/Documentation/sphinx/kerneldoc.py 2023-08-16 12:21:03.000000000 -0400
+++ b/Documentation/sphinx/kerneldoc.py 2023-08-22 10:54:28.646583489 -0400
@@ -148,7 +148,7 @@
lineoffset = int(match.group(1)) - 1
# we must eat our comments since the upset the markup
else:
- doc = env.srcdir + "/" + env.docname + ":" + str(self.lineno)
+ doc = f"{env.srcdir}/{env.docname}:{self.lineno}"
result.append(line, doc + ": " + filename, lineoffset)
lineoffset += 1 Technically one ought use A |
Describe the bug
Linux Kernel 5.4 to 6.4
make htmldocs
fail withTypeError: object of type 'PosixPath' has no len()
andunsupported operand type(s) for +: 'PosixPath' and 'str'
.How to Reproduce
Kernel 5.10. Disable
make all
. Build withmake htmldocs
Environment Information
Sphinx extensions
No response
Additional context
Offending commit is 49d8304
Suspiciously similar to #11618.
The text was updated successfully, but these errors were encountered: