From 4408b842e2d546106b5927b705dda77af36fe57c Mon Sep 17 00:00:00 2001 From: 2xB <31772910+2xB@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:22:44 +0200 Subject: [PATCH] Avoid docutils.nodes.reprunicode `docutils.nodes.reprunicode` was until recently just a subclass of `str`. It was removed in this commit: https://sourceforge.net/p/docutils/code/9415/ Therefore `path = nodes.reprunicode(path)` just converted a string to a string and can therefore be removed. This is an alternative to fixing `docutils` to an old version (as done in #69). Fixes #68 --- m2r2.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/m2r2.py b/m2r2.py index e78d969..7dc8cc4 100644 --- a/m2r2.py +++ b/m2r2.py @@ -10,7 +10,7 @@ from argparse import ArgumentParser, Namespace import mistune -from docutils import io, nodes, statemachine, utils +from docutils import io, statemachine, utils from docutils.parsers import rst from docutils.utils import column_width from pkg_resources import get_distribution @@ -608,7 +608,6 @@ def run(self): path = rst.directives.path(self.arguments[0]) path = os.path.normpath(os.path.join(source_dir, path)) path = utils.relative_path(None, path) - path = nodes.reprunicode(path) # get options (currently not use directive-specific options) encoding = self.options.get(