Fix: Output TeX/texinfo/man filename has no basename (only extention) when using multibyte characters to "Project name" on quickstart. Closes #1190

This commit is contained in:
Takayuki Shimizukawa
2013-06-13 03:22:23 +00:00
parent f24eb8c47d
commit 8c543c11cc
3 changed files with 25 additions and 1 deletions

View File

@@ -30,6 +30,8 @@ Bugs fixed
includes non-ASCII characters.
* #1189: "Title underline is short" WARNING is given when using fullwidth
characters to "Project name" on quickstart.
* #1190: Output TeX/texinfo/man filename has no basename (only extention)
when using multibyte characters to "Project name" on quickstart.
Release 1.2 (beta1 released Mar 31, 2013)

View File

@@ -134,7 +134,7 @@ def copyfile(source, dest):
no_fn_re = re.compile(r'[^a-zA-Z0-9_-]')
def make_filename(string):
return no_fn_re.sub('', string)
return no_fn_re.sub('', string) or 'sphinx'
if sys.version_info < (3, 0):
# strftime for unicode strings

View File

@@ -263,3 +263,25 @@ def test_quickstart_and_build(tmpdir):
app.builder.build_all()
warnings = warnfile.getvalue()
assert not warnings
@with_tempdir
def test_default_filename(tempdir):
answers = {
'Root path': tempdir,
'Project name': u'\u30c9\u30a4\u30c4', #Fullwidth characters only
'Author name': 'Georg Brandl',
'Project version': '0.1',
}
qs.term_input = mock_raw_input(answers)
d = {}
qs.ask_user(d)
qs.generate(d)
conffile = tempdir / 'conf.py'
assert conffile.isfile()
ns = {}
execfile_(conffile, ns)
assert ns['latex_documents'][0][1] == 'sphinx.tex'
assert ns['man_pages'][0][1] == 'sphinx'
assert ns['texinfo_documents'][0][1] == 'sphinx'