Issue #1188 resolved

sphinx-quickstart raises UnicodeEncodeError if "Project version" includes non-ASCII characters

Takeshi Komiya
created an issue

With 1.2b1, I got UnicodeEncodeError when I ran sphinx-quickstart and input Japanese characters (UTF-8) as "Project Version". The error is below:

$ sphinx-quickstart docs                                                                                          ~/work/sphinx-1.2b-test
Welcome to the Sphinx 1.2b1 quickstart utility.

Please enter values for the following settings (just press Enter to
accept a default value, if one is given in brackets).

Selected root path: docs

You have two options for placing the build directory for Sphinx output.
Either, you use a directory "_build" within the root path, or you separate
"source" and "build" directories within the root path.
> Separate source and build directories (y/N) [n]:

Inside the root directory, two more directories will be created; "_templates"
for custom HTML templates and "_static" for custom stylesheets and other static
files. You can enter another prefix (such as ".") to replace the underscore.
> Name prefix for templates and static dir [_]:

The project name will occur in several places in the built documentation.
> Project name: Example
> Author name(s): Example

Sphinx has the notion of a "version" and a "release" for the
software. Each version can have multiple releases. For example, for
Python the version is something like 2.5 or 3.0, while the release is
something like 2.5.1 or 3.0a1.  If you don't need this dual structure,
just set both to the same value.
> Project version: あいうえお
Traceback (most recent call last):
  File "/Users/tkomiya/work/sphinx-1.2b-test/bin/sphinx-quickstart", line 8, in <module>
    load_entry_point('Sphinx==1.2b1', 'console_scripts', 'sphinx-quickstart')()
  File "/Users/tkomiya/work/sphinx-1.2b-test/lib/python2.7/site-packages/sphinx/", line 1164, in main
  File "/Users/tkomiya/work/sphinx-1.2b-test/lib/python2.7/site-packages/sphinx/", line 976, in ask_user
    do_prompt(d, 'release', 'Project release', d['version'])
  File "/Users/tkomiya/work/sphinx-1.2b-test/lib/python2.7/site-packages/sphinx/", line 864, in do_prompt
    x = term_input(prompt).strip()
UnicodeEncodeError: 'ascii' codec can't encode characters in position 24-28: ordinal not in range(128)

It seems quickstart try to show prompt of "Project release". but it fails on displaying non-ASCII chars.

Comments (3)

  1. Log in to comment