Issue #1188 resolved

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

Takeshi Komiya avatarTakeshi 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/quickstart.py", line 1164, in main
    ask_user(d)
  File "/Users/tkomiya/work/sphinx-1.2b-test/lib/python2.7/site-packages/sphinx/quickstart.py", 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/quickstart.py", 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 (2)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.