Skip to content

Commit

Permalink
Fix sphinx-doc#8959: using UNIX path separator confuses Sphinx on Win…
Browse files Browse the repository at this point in the history
…dows
  • Loading branch information
tk0miya committed Mar 6, 2021
1 parent 4f8cb86 commit 1e1c86a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Expand Up @@ -13,6 +13,8 @@ Deprecated
Features added
--------------

* #8959: using UNIX path separator in image directive confuses Sphinx on Windows

Bugs fixed
----------

Expand Down
2 changes: 2 additions & 0 deletions sphinx/environment/__init__.py
Expand Up @@ -34,6 +34,7 @@
from sphinx.util.docutils import LoggingReporter
from sphinx.util.i18n import CatalogRepository, docname_to_domain
from sphinx.util.nodes import is_translatable
from sphinx.util.osutil import os_path

if False:
# For type annotation
Expand Down Expand Up @@ -351,6 +352,7 @@ def relfn2path(self, filename: str, docname: str = None) -> Tuple[str, str]:
source dir, while relative filenames are relative to the dir of the
containing document.
"""
filename = os_path(filename)
if filename.startswith('/') or filename.startswith(os.sep):
rel_fn = filename[1:]
else:
Expand Down

0 comments on commit 1e1c86a

Please sign in to comment.