Issues

Issue #1043 resolved

sphinx-quickstart asks again and again Y|N on MS DOS / MS Windows

Régis Décamps
created an issue

When run on MS DOS / MS Windows (Command line or MinGW32), sphinx-quickstart loops on boolean questions:

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]:
* Please enter either 'y' or 'n'.
> Separate source and build directories (y/N) [n]: n
* Please enter either 'y' or 'n'.
> Separate source and build directories (y/N) [n]: N
* Please enter either 'y' or 'n'.

Comments (8)

  1. Régis Décamps reporter

    The reason is that the input() methods returns the return character \r. I sugguest this easy fix:

    def do_prompt(d, key, text, default=None, validator=nonempty):
        while True:
            if default:
                prompt = purple(PROMPT_PREFIX + '%s [%s]: ' % (text, default))
            else:
                prompt = purple(PROMPT_PREFIX + text + ': ')
    -        x = term_input(prompt)
    +        x = term_input(prompt).strip()
            if default and not x:
                x = default
    
  2. Log in to comment