File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -729,8 +729,11 @@ def render_as_markdown(
729
729
# pylint: disable=duplicate-code
730
730
parts = publish_parts (
731
731
source = source ,
732
- source_path = source_path ,
733
- destination_path = destination_path ,
732
+ # The type information for the following two parameters seems to be wrong.
733
+ # According to the docutils sources the expected type is StrPath | None, which
734
+ # is defined as str | os.PathLike[str] | None.
735
+ source_path = source_path , # type: ignore
736
+ destination_path = destination_path , # type: ignore
734
737
parser_name = parser_name ,
735
738
writer = MarkDownWriter (document_context ),
736
739
settings_overrides = get_docutils_publish_settings (
Original file line number Diff line number Diff line change @@ -286,8 +286,12 @@ def _parse_document(
286
286
287
287
# Parse the document
288
288
try :
289
+ # mypy gives errors for the next line, but this is literally what docutils itself
290
+ # is also doing. So we're going to ignore this error...
289
291
return publisher .reader .read (
290
- publisher .source , publisher .parser , publisher .settings
292
+ publisher .source ,
293
+ publisher .parser ,
294
+ publisher .settings , # type: ignore
291
295
)
292
296
except SystemMessage as exc :
293
297
raise ValueError (f"Cannot parse document: { exc } " ) from exc
You can’t perform that action at this time.
0 commit comments