diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-03-20 23:07:44 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-03-20 23:07:44 +0900 |
commit | 82f495fed386c798735adf675f867b95d61ee0e1 (patch) | |
tree | b152839fc6a9f70625374e89b31ef612c8334574 | |
parent | f7768d8282e2051596b5df54ecf144505cb8f4f5 (diff) | |
parent | 14ff1bcf72d17b7ed9ed074f5a2e56da8dc56dcc (diff) | |
download | sphinx-git-82f495fed386c798735adf675f867b95d61ee0e1.tar.gz |
Merge branch '3.5.x' into 3.x
-rw-r--r-- | CHANGES | 10 | ||||
-rw-r--r-- | sphinx/__init__.py | 6 | ||||
-rw-r--r-- | sphinx/environment/__init__.py | 5 | ||||
-rw-r--r-- | tests/test_build.py | 10 |
4 files changed, 19 insertions, 12 deletions
@@ -1,4 +1,4 @@ -Release 3.5.3 (in development) +Release 3.5.4 (in development) ============================== Dependencies @@ -19,6 +19,14 @@ Bugs fixed Testing -------- +Release 3.5.3 (released Mar 20, 2021) +===================================== + +Features added +-------------- + +* #8959: using UNIX path separator in image directive confuses Sphinx on Windows + Release 3.5.2 (released Mar 06, 2021) ===================================== diff --git a/sphinx/__init__.py b/sphinx/__init__.py index 7f72a3d02..e72c9f81c 100644 --- a/sphinx/__init__.py +++ b/sphinx/__init__.py @@ -32,8 +32,8 @@ if 'PYTHONWARNINGS' not in os.environ: warnings.filterwarnings('ignore', "'U' mode is deprecated", DeprecationWarning, module='docutils.io') -__version__ = '3.5.3+' -__released__ = '3.5.3' # used when Sphinx builds its own docs +__version__ = '3.5.4+' +__released__ = '3.5.4' # used when Sphinx builds its own docs #: Version info for better programmatic use. #: @@ -43,7 +43,7 @@ __released__ = '3.5.3' # used when Sphinx builds its own docs #: #: .. versionadded:: 1.2 #: Before version 1.2, check the string ``sphinx.__version__``. -version_info = (3, 5, 3, 'beta', 0) +version_info = (3, 5, 4, 'beta', 0) package_dir = path.abspath(path.dirname(__file__)) diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py index af3e2b8d5..6b2acab9f 100644 --- a/sphinx/environment/__init__.py +++ b/sphinx/environment/__init__.py @@ -10,7 +10,6 @@ import os import pickle -import posixpath import warnings from collections import defaultdict from copy import copy @@ -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 False: # For type annotation @@ -351,6 +351,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: @@ -358,7 +359,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 diff --git a/tests/test_build.py b/tests/test_build.py index 62de3ea5f..bd2523b3d 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -16,7 +16,6 @@ import pytest from docutils import nodes from sphinx.errors import SphinxError -from sphinx.testing.path import path def request_session_head(url, **kwargs): @@ -137,17 +136,16 @@ def test_image_glob(app, status, warning): doctree = app.env.get_doctree('subdir/index') assert isinstance(doctree[0][1], nodes.image) - sub = path('subdir') - assert doctree[0][1]['candidates'] == {'*': sub / 'rimg.png'} - assert doctree[0][1]['uri'] == sub / 'rimg.png' + assert doctree[0][1]['candidates'] == {'*': 'subdir/rimg.png'} + assert doctree[0][1]['uri'] == 'subdir/rimg.png' assert isinstance(doctree[0][2], nodes.image) assert doctree[0][2]['candidates'] == {'application/pdf': 'subdir/svgimg.pdf', 'image/svg+xml': 'subdir/svgimg.svg'} - assert doctree[0][2]['uri'] == sub / 'svgimg.*' + assert doctree[0][2]['uri'] == 'subdir/svgimg.*' assert isinstance(doctree[0][3], nodes.figure) assert isinstance(doctree[0][3][0], nodes.image) assert doctree[0][3][0]['candidates'] == {'application/pdf': 'subdir/svgimg.pdf', 'image/svg+xml': 'subdir/svgimg.svg'} - assert doctree[0][3][0]['uri'] == sub / 'svgimg.*' + assert doctree[0][3][0]['uri'] == 'subdir/svgimg.*' |