diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2015-12-25 15:52:51 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2015-12-25 15:52:51 +0900 |
commit | f1cf5d594a8cdb3a5008d700af6b88084e634dc6 (patch) | |
tree | 5753dab1e8bb97967ad84f54a50fc51229cd8aa2 /sphinx/apidoc.py | |
parent | 0719611d54b7f40233c2e69439b35dd2b08f98b0 (diff) | |
download | sphinx-git-f1cf5d594a8cdb3a5008d700af6b88084e634dc6.tar.gz |
Fix #2040: UnicodeDecodeError in sphinx-apidoc when author contains non-ascii characters
Diffstat (limited to 'sphinx/apidoc.py')
-rw-r--r-- | sphinx/apidoc.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sphinx/apidoc.py b/sphinx/apidoc.py index 10311e6f3..73bb963ce 100644 --- a/sphinx/apidoc.py +++ b/sphinx/apidoc.py @@ -353,10 +353,10 @@ Note: By default this script will not overwrite already created files.""") path = opts.destdir, sep = False, dot = '_', - project = opts.header, - author = opts.author or 'Author', - version = opts.version or '', - release = opts.release or opts.version or '', + project = None, + author = 'Author', + version = '', + release = '', suffix = '.' + opts.suffix, master = 'index', epub = True, @@ -369,6 +369,17 @@ Note: By default this script will not overwrite already created files.""") mastertoctree = text, language = 'en', ) + if opts.header: + d['project'] = opts.header.decode('utf-8') + if opts.author: + d['author'] = opts.author.decode('utf-8') + if opts.version: + d['version'] = opts.version.decode('utf-8') + if opts.release: + d['release'] = opts.release.decode('utf-8') + elif opts.version: + d['release'] = opts.version.decode('utf-8') + if not opts.dryrun: qs.generate(d, silent=True, overwrite=opts.force) elif not opts.notoc: |