Failure when running Sphinx 1.2b2

astrofrog avatarastrofrog 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/application.py", line 138, in __init__
    self._init_env(freshenv)
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/sphinx/application.py", line 184, in _init_env
    return self._init_env(freshenv=True)
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/sphinx/application.py", line 166, in _init_env
    self.env.find_files(self.config)
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/sphinx/environment.py", 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/__init__.py", 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/__init__.py", 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/__init__.py", line 74, in <genexpr>
    for dn in dirs)
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/sphinx/util/__init__.py", 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 (5)

  1. astrofrog

    One way to fix this is to use:

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

    in sphinx/util/__init__.py on line 57.

  2. 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.