mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #1112: Avoid duplicate download files when referenced from documents in
different ways (absolute/relative).
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -163,6 +163,8 @@ Bugs fixed
|
||||
* #1126: Fix double-hyphen to en-dash conversion in wrong places such as
|
||||
command-line option names in LaTeX.
|
||||
* #1117: Handle .pyx files in sphinx-apidoc.
|
||||
* #1112: Avoid duplicate download files when referenced from documents in
|
||||
different ways (absolute/relative).
|
||||
* #1111: Fix failure to find uppercase words in search when
|
||||
:confval:`html_search_language` is 'ja'. Thanks to Tomo Saito.
|
||||
* #1108: The text writer now correctly numbers enumerated lists with
|
||||
|
@@ -320,12 +320,14 @@ class BuildEnvironment:
|
||||
base=None))
|
||||
rel_fn = path.join(docdir, filename)
|
||||
try:
|
||||
return rel_fn, path.join(self.srcdir, rel_fn)
|
||||
# the path.abspath() might seem redundant, but otherwise artifacts
|
||||
# such as ".." will remain in the path
|
||||
return rel_fn, path.abspath(path.join(self.srcdir, rel_fn))
|
||||
except UnicodeDecodeError:
|
||||
# the source directory is a bytestring with non-ASCII characters;
|
||||
# let's try to encode the rel_fn in the file system encoding
|
||||
enc_rel_fn = rel_fn.encode(sys.getfilesystemencoding())
|
||||
return rel_fn, path.join(self.srcdir, enc_rel_fn)
|
||||
return rel_fn, path.abspath(path.join(self.srcdir, enc_rel_fn))
|
||||
|
||||
def find_files(self, config):
|
||||
"""Find all source files in the source dir and put them in
|
||||
|
Reference in New Issue
Block a user