diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-01-08 20:21:31 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-01-09 07:37:01 +0300 |
commit | 43eeb96e2f258583b7c3017f9affd5b8e2072e18 (patch) | |
tree | 4ae67af71e8a5b82f0ab46e865cca6e8863dc48d /sphinx/util/fileutil.py | |
parent | 175c6e66a6d3c23c3efecb27d22c44d9525db545 (diff) |
Fix copy_asset_file() rewrote destination-filename
Diffstat (limited to 'sphinx/util/fileutil.py')
-rw-r--r-- | sphinx/util/fileutil.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sphinx/util/fileutil.py b/sphinx/util/fileutil.py index 4375b7e61..b258c2039 100644 --- a/sphinx/util/fileutil.py +++ b/sphinx/util/fileutil.py @@ -41,7 +41,9 @@ def copy_asset_file(source, destination, context=None, renderer=None): renderer = SphinxRenderer() with codecs.open(source, 'r', encoding='utf-8') as fsrc: - with codecs.open(destination[:-2], 'w', encoding='utf-8') as fdst: + if destination.lower().endswith('_t'): + destination = destination[:-2] + with codecs.open(destination, 'w', encoding='utf-8') as fdst: fdst.write(renderer.render_string(fsrc.read(), context)) else: copyfile(source, destination) |