Skip to content

Commit

Permalink
builder: use pathlib for internal imgmath override
Browse files Browse the repository at this point in the history
Updating the internal overwrite of the imgmath temporary directory to
use the pathlib module. Upstream version of Sphinx has updated its
implementation to use pathlib, and using a str causes issues when
running the imgmath extension.

Using `Path` should be fine for existing/older versions of Sphinx, as
its value used with `os.path.join` handles `Path` objects.

Signed-off-by: James Knight <git@jdknight.me>
  • Loading branch information
jdknight committed Jan 30, 2025
1 parent 568064a commit 0fbee50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sphinxcontrib/confluencebuilder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ def init(self):
# The imgmath extension allows a builder to override where temporary
# files are build -- use this to hint to using a temporary directory
# on the same partition the output directory to help prevent issues.
self._imgmath_tempdir = tempfile.mkdtemp(
prefix='.imgmath-', dir=self.out_dir)
self._imgmath_tempdir = Path(tempfile.mkdtemp(
prefix='.imgmath-', dir=self.out_dir))

if self.config.confluence_publish:
process_ask_configs(self.config)
Expand Down

0 comments on commit 0fbee50

Please sign in to comment.