Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-03-20 17:25:57 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-03-20 17:25:57 +0300
commit5e8f814e81ef11da9efc48f4efd6647c5bfa4596 (patch)
tree7ed1827ce96d667bd2b4ed3b05272a8ceca00c20 /sphinx/environment
parent560def9606af39431e62b30c5a7b44ccbd3964c8 (diff)
parent82f495fed386c798735adf675f867b95d61ee0e1 (diff)
Merge branch '3.x'
Diffstat (limited to 'sphinx/environment')
-rw-r--r--sphinx/environment/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py
index 60ede8188..96b060cd6 100644
--- a/sphinx/environment/__init__.py
+++ b/sphinx/environment/__init__.py
@@ -10,7 +10,6 @@
import os
import pickle
-import posixpath
from collections import defaultdict
from copy import copy
from datetime import datetime
@@ -34,6 +33,7 @@ from sphinx.util import DownloadFiles, FilenameUniqDict, logging
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 canon_path, os_path
if TYPE_CHECKING:
from sphinx.application import Sphinx
@@ -335,6 +335,7 @@ class BuildEnvironment:
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:
@@ -342,7 +343,7 @@ class BuildEnvironment:
base=None))
rel_fn = path.join(docdir, filename)
- return (posixpath.normpath(rel_fn),
+ return (canon_path(path.normpath(rel_fn)),
path.normpath(path.join(self.srcdir, rel_fn)))
@property