Skip to content

Commit 7d54e60

Browse files
authored
Make sure path-like objects are converted to strings first. (#13)
1 parent 6802f17 commit 7d54e60

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

changelogs/fragments/13-path.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bugfixes:
2+
- "Ensure that ``path`` and ``root_prefix`` for ``antsibull_docutils.rst_code_finder.find_code_blocks()`` can actually be path-like objects (https://github.com/ansible-community/antsibull-docutils/pull/13)."

src/antsibull_docutils/rst_code_finder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def _parse_document(
273273
publisher = Publisher(source_class=StringInput)
274274
publisher.set_components("standalone", "restructuredtext", "pseudoxml")
275275
override = {
276-
"root_prefix": root_prefix,
276+
"root_prefix": str(root_prefix),
277277
"input_encoding": "utf-8",
278278
"file_insertion_enabled": False,
279279
"raw_enabled": False,
@@ -282,7 +282,7 @@ def _parse_document(
282282
"warning_stream": io.StringIO(),
283283
}
284284
publisher.process_programmatic_settings(None, override, None)
285-
publisher.set_source(content, path)
285+
publisher.set_source(content, str(path))
286286

287287
# Parse the document
288288
try:

0 commit comments

Comments
 (0)