Skip to content

Commit d24613b

Browse files
committed
translator: handle new pathlib usage in sphinx-env
Sphinx environment's `doc2path` call now returns a Path [1]; updating the source-link logic to handle a string conversion before extracting the suffix. [1]: sphinx-doc/sphinx@de15d61 Signed-off-by: James Knight <[email protected]> (cherry picked from commit 4da8461)
1 parent 40c3040 commit d24613b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sphinxcontrib/confluencebuilder/storage/translator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2560,7 +2560,8 @@ def visit_confluence_source_link(self, node):
25602560
uri = PARAMS(node)['url']
25612561

25622562
docname = self.docname
2563-
suffix = self.builder.env.doc2path(docname, base=None)[len(docname):]
2563+
docpath = str(self.builder.env.doc2path(docname, base=None))
2564+
suffix = docpath[len(docname):]
25642565
uri = uri.format(page=docname, suffix=suffix, **PARAMS(node))
25652566

25662567
source_text = PARAMS(node).get('text', L('Edit Source'))

0 commit comments

Comments
 (0)