From 1b21f69c93c0070b5a80d22fa3b9c7b583b14eb3 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 16:03:51 +0000 Subject: [PATCH] fix(docs): Drop removed docutils error_reporting import - docutils 0.22 removed docutils.error_reporting - Use the plain path and error values in the error messages Co-Authored-By: Claude Sonnet 5.5 --- docs/cmake.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/docs/cmake.py b/docs/cmake.py index 58db6d6..8cc431c 100644 --- a/docs/cmake.py +++ b/docs/cmake.py @@ -61,11 +61,6 @@ from docutils.parsers.rst import Directive, directives from docutils.transforms import Transform -try: - from docutils.utils.error_reporting import SafeString, ErrorString -except ImportError: - # error_reporting was not in utils before version 0.11: - from docutils.error_reporting import SafeString, ErrorString from docutils import io, nodes @@ -135,10 +130,10 @@ def run(self): raise self.severe('Problems with "%s" directive path:\n' 'Cannot encode input file path "%s" ' '(wrong locale?).' % - (self.name, SafeString(path))) + (self.name, path)) except IOError as error: raise self.severe('Problems with "%s" directive path:\n%s.' % - (self.name, ErrorString(error))) + (self.name, error)) raw_lines = f.read().splitlines() f.close() rst = None