Closes #1112: Avoid duplicate download files when referenced from documents in

different ways (absolute/relative).
This commit is contained in:
Georg Brandl
2013-03-30 12:44:39 +01:00
parent 2f03bb5f12
commit 181b075251
2 changed files with 6 additions and 2 deletions

View File

@@ -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

View File

@@ -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