Pull requests

#98 Merged
Repository
mizhi mizhi
Branch
default
Repository
birkenfeld birkenfeld
Branch
default

Fixes TypeError raised from generate_indices in sphinx/writers/latex.py

Author
  1. Mitchell Peabody
Reviewers
Description

Encountered this error using autoflask from sphinxcontrib-httpdomain. When

.. autoflask::

was used in a rst file, the command

$ make latexpdf

would result in the following error:

Exception occurred: File "/Users/mizhi/Development/python/virtualenvs/flask/lib/python2.7/site-packages/sphinx/writers/latex.py", line 295, in generate letter.translate(tex_escape_map)) TypeError: expected a character buffer object

This small change eliminates the behavior. There are two versions of the translate method: one for ascii strings and one for unicode. The translate method for ascii strings expects a table that is a 256 character string. The unicode version of translate expects a dictionary. The translate method is using the tex_escape_map, which is a dictionary, so this change merely guarantees that the version being called is the unicode version.

Comments (1)