Skip to content

Commit

Permalink
Merge pull request #12349 from meeseeksmachine/auto-backport-of-pr-12…
Browse files Browse the repository at this point in the history
…342-on-7.x

Backport PR #12342 on branch 7.x (Fixed bug on windows where relative image path has wrong slashes)
  • Loading branch information
Carreau committed May 29, 2020
2 parents 0cf8ac5 + d7d4556 commit 54506fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions IPython/sphinxext/ipython_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ def process_image(self, decorator):
# insert relative path to image file in source
# as absolute path for Sphinx
# sphinx expects a posix path, even on Windows
posix_path = pathlib.Path(savefig_dir,filename).as_posix()
outfile = '/' + os.path.relpath(posix_path, source_dir)
path = pathlib.Path(savefig_dir, filename)
outfile = '/' + path.relative_to(source_dir).as_posix()

imagerows = ['.. image:: %s' % outfile]

Expand Down

0 comments on commit 54506fb

Please sign in to comment.