Skip to content

Commit c8aae46

Browse files
authored
[fix]: TypeError in phpdomain when fullname is _StrPath object
Resolves TypeError: can only concatenate str (not "_StrPath") to str in sphinxcontrib/phpdomain.py:396 by explicitly converting fullname to string before string formatting. The add_target_and_index method was failing when fullname parameter was a _StrPath object instead of a string. Added str() conversion to ensure proper string concatenation in the error message.
1 parent bbde5f8 commit c8aae46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sphinxcontrib/phpdomain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ def add_target_and_index(self, name_cls, sig, signode):
393393
objects = self.env.domaindata["php"]["objects"]
394394
if fullname in objects:
395395
self.state_machine.reporter.warning(
396-
"duplicate object description of %s, " % fullname
396+
"duplicate object description of %s, " % str(fullname)
397397
+ "other instance in "
398398
+ self.env.doc2path(objects[fullname][0]),
399399
line=self.lineno,

0 commit comments

Comments
 (0)