Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7c0fb6e

Browse filesBrowse files
committed
Merge pull request #5279 from cgohlke/patch-17
On Windows, use absolute paths to figures in Sphinx documents if necessary
1 parent f529327 commit 7c0fb6e
Copy full SHA for 7c0fb6e

File tree

Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed

‎lib/matplotlib/sphinxext/plot_directive.py

Copy file name to clipboardExpand all lines: lib/matplotlib/sphinxext/plot_directive.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,12 @@ def run(arguments, content, options, state_machine, state, lineno):
748748
# how to link to files from the RST file
749749
dest_dir_link = os.path.join(relpath(setup.confdir, rst_dir),
750750
source_rel_dir).replace(os.path.sep, '/')
751-
build_dir_link = relpath(build_dir, rst_dir).replace(os.path.sep, '/')
751+
try:
752+
build_dir_link = relpath(build_dir, rst_dir).replace(os.path.sep, '/')
753+
except ValueError:
754+
# on Windows, relpath raises ValueError when path and start are on
755+
# different mounts/drives
756+
build_dir_link = build_dir
752757
source_link = dest_dir_link + '/' + output_base + source_ext
753758

754759
# make figures

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.