Issue #1272 resolved

Failure when running Sphinx 1.2b2

created an issue

I'm seeing the following failure when running sphinx-build on a project which previously worked:

Running Sphinx v1.2b2
loading pickled environment... not yet created
ERROR: TypeError: must be unicode, not str [sphinx.util]
Traceback (most recent call last):
  File "<stdin>", line 26, in <module>
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/sphinx/", line 138, in __init__
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/sphinx/", line 184, in _init_env
    return self._init_env(freshenv=True)
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/sphinx/", line 166, in _init_env
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/sphinx/", line 345, in find_files
    self.srcdir, config.source_suffix, exclude_matchers=matchers))
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/sphinx/util/", line 94, in get_matching_docs
    for filename in get_matching_files(dirname, exclude_matchers):
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/sphinx/util/", line 78, in get_matching_files
    qdirs = [entry for entry in qdirs if not matcher(entry[1])]
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/sphinx/util/", line 74, in <genexpr>
    for dn in dirs)
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/sphinx/util/", line 57, in path_stabilize
    newpath = unicodedata.normalize('NFC', newpath)
TypeError: must be unicode, not str

I see this on MacOS X and also Linux (on Travis).

Let me know if I can provide any information to help diagnose this.

Comments (6)

  1. astrofrog reporter

    One way to fix this is to use:

    newpath = unicodedata.normalize('NFC', newpath.decode('utf-8'))

    in sphinx/util/ on line 57.

  2. Log in to comment