Skip to content

Commit 82f495f

Browse files
committed
Merge branch '3.5.x' into 3.x
2 parents f7768d8 + 14ff1bc commit 82f495f

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

CHANGES

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Release 3.5.3 (in development)
1+
Release 3.5.4 (in development)
22
==============================
33

44
Dependencies
@@ -19,6 +19,14 @@ Bugs fixed
1919
Testing
2020
--------
2121

22+
Release 3.5.3 (released Mar 20, 2021)
23+
=====================================
24+
25+
Features added
26+
--------------
27+
28+
* #8959: using UNIX path separator in image directive confuses Sphinx on Windows
29+
2230
Release 3.5.2 (released Mar 06, 2021)
2331
=====================================
2432

sphinx/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
warnings.filterwarnings('ignore', "'U' mode is deprecated",
3333
DeprecationWarning, module='docutils.io')
3434

35-
__version__ = '3.5.3+'
36-
__released__ = '3.5.3' # used when Sphinx builds its own docs
35+
__version__ = '3.5.4+'
36+
__released__ = '3.5.4' # used when Sphinx builds its own docs
3737

3838
#: Version info for better programmatic use.
3939
#:
@@ -43,7 +43,7 @@
4343
#:
4444
#: .. versionadded:: 1.2
4545
#: Before version 1.2, check the string ``sphinx.__version__``.
46-
version_info = (3, 5, 3, 'beta', 0)
46+
version_info = (3, 5, 4, 'beta', 0)
4747

4848
package_dir = path.abspath(path.dirname(__file__))
4949

sphinx/environment/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import os
1212
import pickle
13-
import posixpath
1413
import warnings
1514
from collections import defaultdict
1615
from copy import copy
@@ -34,6 +33,7 @@
3433
from sphinx.util.docutils import LoggingReporter
3534
from sphinx.util.i18n import CatalogRepository, docname_to_domain
3635
from sphinx.util.nodes import is_translatable
36+
from sphinx.util.osutil import canon_path, os_path
3737

3838
if False:
3939
# For type annotation
@@ -351,14 +351,15 @@ def relfn2path(self, filename: str, docname: str = None) -> Tuple[str, str]:
351351
source dir, while relative filenames are relative to the dir of the
352352
containing document.
353353
"""
354+
filename = os_path(filename)
354355
if filename.startswith('/') or filename.startswith(os.sep):
355356
rel_fn = filename[1:]
356357
else:
357358
docdir = path.dirname(self.doc2path(docname or self.docname,
358359
base=None))
359360
rel_fn = path.join(docdir, filename)
360361

361-
return (posixpath.normpath(rel_fn),
362+
return (canon_path(path.normpath(rel_fn)),
362363
path.normpath(path.join(self.srcdir, rel_fn)))
363364

364365
@property

tests/test_build.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from docutils import nodes
1717

1818
from sphinx.errors import SphinxError
19-
from sphinx.testing.path import path
2019

2120

2221
def request_session_head(url, **kwargs):
@@ -137,17 +136,16 @@ def test_image_glob(app, status, warning):
137136
doctree = app.env.get_doctree('subdir/index')
138137

139138
assert isinstance(doctree[0][1], nodes.image)
140-
sub = path('subdir')
141-
assert doctree[0][1]['candidates'] == {'*': sub / 'rimg.png'}
142-
assert doctree[0][1]['uri'] == sub / 'rimg.png'
139+
assert doctree[0][1]['candidates'] == {'*': 'subdir/rimg.png'}
140+
assert doctree[0][1]['uri'] == 'subdir/rimg.png'
143141

144142
assert isinstance(doctree[0][2], nodes.image)
145143
assert doctree[0][2]['candidates'] == {'application/pdf': 'subdir/svgimg.pdf',
146144
'image/svg+xml': 'subdir/svgimg.svg'}
147-
assert doctree[0][2]['uri'] == sub / 'svgimg.*'
145+
assert doctree[0][2]['uri'] == 'subdir/svgimg.*'
148146

149147
assert isinstance(doctree[0][3], nodes.figure)
150148
assert isinstance(doctree[0][3][0], nodes.image)
151149
assert doctree[0][3][0]['candidates'] == {'application/pdf': 'subdir/svgimg.pdf',
152150
'image/svg+xml': 'subdir/svgimg.svg'}
153-
assert doctree[0][3][0]['uri'] == sub / 'svgimg.*'
151+
assert doctree[0][3][0]['uri'] == 'subdir/svgimg.*'

0 commit comments

Comments
 (0)