nyergler / hieroglyph

Generate HTML presentations from plain text sources with all the power of Sphinx.
https://hieroglyph.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
261 stars 73 forks source link

Using accents in hieroglyph-quickstart fails with UnicodeError #130

Closed arthurzenika closed 5 years ago

arthurzenika commented 7 years ago
Welcome to the Hieroglyph 1.0.0 quickstart utility.
> Presentation title: Qualité du code
[snip]
Traceback (most recent call last):
  File "/home/arthur/.virtualenvs/formation/lib/python3.5/encodings/idna.py", line 181, in encode
    result.extend(ToASCII(label))
  File "/home/arthur/.virtualenvs/formation/lib/python3.5/encodings/idna.py", line 103, in ToASCII
    raise UnicodeError("label empty or too long")
UnicodeError: label empty or too long

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/arthur/.virtualenvs/formation/bin/hieroglyph-quickstart", line 11, in <module>
    sys.exit(quickstart())
  File "/home/arthur/.virtualenvs/formation/lib/python3.5/site-packages/hieroglyph/quickstart.py", line 94, in quickstart
    sphinx.quickstart.generate(d, templatedir=templatedir)
  File "/home/arthur/.virtualenvs/formation/lib/python3.5/site-packages/sphinx/quickstart.py", line 412, in generate
    d['project_url'] = urlquote(d['project'].encode('idna'))
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)
$ pip show hieroglyph
Name: hieroglyph
Version: 1.0.0
Summary: Generate HTML presentations from plain text sources with all the power of Sphinx.
Home-page: https://github.com/nyergler/hieroglyph
Author: Nathan Yergler
Author-email: nathan@yergler.net
License: BSD
Location: /home/arthur/.virtualenvs/formation/lib/python3.5/site-packages
Requires: setuptools, Sphinx, six
nyergler commented 7 years ago

I haven't dug into this deeply, but this appears to be a Sphinx issue. To test that you'd need to try running sphinx-quickstart with the same input (although it calls it "project title" not "presentation title") and see if it succeeds.

I believe it's a Sphinx issue because we're using Sphinx's prompt support, as well as quickstart generation. Looking at how they prompt for the title, it doesn't appear that Sphinx does any additional processing.

nyergler commented 5 years ago

Just tested this with the latest Sphinx + Hieroglyph master and it appears to be working. Despite the delay in closing, thank you for reporting!