From 8b7dfa401692b8125001bf6f227d810e592e6256 Mon Sep 17 00:00:00 2001 From: James Knight Date: Thu, 5 Dec 2024 00:19:50 -0500 Subject: [PATCH] drop str-casts for mimetype requests Paths pushed into `guess_mimetype` were casted to strings to support Sphinx-6.1 and older versions. Since we no longer support these versions, dropping these casts. Signed-off-by: James Knight --- sphinxcontrib/confluencebuilder/assets.py | 3 +-- sphinxcontrib/confluencebuilder/svg.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sphinxcontrib/confluencebuilder/assets.py b/sphinxcontrib/confluencebuilder/assets.py index e7c677ad..4b66d43c 100644 --- a/sphinxcontrib/confluencebuilder/assets.py +++ b/sphinxcontrib/confluencebuilder/assets.py @@ -273,8 +273,7 @@ def _handle_entry(self, path, docname, standalone=False): if path not in self.path2asset: hash_ = ConfluenceUtil.hash_asset(path) - # str-cast for sphinx-6.1 - type_ = guess_mimetype(str(path), default=DEFAULT_CONTENT_TYPE) + type_ = guess_mimetype(path, default=DEFAULT_CONTENT_TYPE) else: hash_ = self.path2asset[path].hash type_ = self.path2asset[path].type diff --git a/sphinxcontrib/confluencebuilder/svg.py b/sphinxcontrib/confluencebuilder/svg.py index 4111c700..d49df1f4 100644 --- a/sphinxcontrib/confluencebuilder/svg.py +++ b/sphinxcontrib/confluencebuilder/svg.py @@ -65,7 +65,7 @@ def confluence_supported_svg(builder, node): return # ignore non-svgs - mimetype = guess_mimetype(str(abs_path)) # cast for sphinx-6.1 + mimetype = guess_mimetype(abs_path) if mimetype != 'image/svg+xml': return