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

The first element of env.relfn2path() should be a OS dependent path, not
a posix path.
  • Loading branch information
tk0miya committed Mar 19, 2021
1 parent 4f8cb86 commit 1050c26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 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
3 changes: 1 addition & 2 deletions sphinx/environment/__init__.py
Expand Up @@ -10,7 +10,6 @@

import os
import pickle
import posixpath
import warnings
from collections import defaultdict
from copy import copy
Expand Down Expand Up @@ -358,7 +357,7 @@ def relfn2path(self, filename: str, docname: str = None) -> Tuple[str, str]:
base=None))
rel_fn = path.join(docdir, filename)

return (posixpath.normpath(rel_fn),
return (path.normpath(rel_fn),
path.normpath(path.join(self.srcdir, rel_fn)))

@property
Expand Down

0 comments on commit 1050c26

Please sign in to comment.