diff options
| author | Georg Brandl <georg@python.org> | 2010-01-12 10:45:38 +0000 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2010-01-12 10:45:38 +0000 |
| commit | 151f182a2c55b9c6904475c753ee961460ef7823 (patch) | |
| tree | 617f8496beabaeeae6ad4f56b146b48ba44798bb /sphinx/builders/latex.py | |
| parent | 916f6fc763b4d06a5da41f9f84377c8ddfd1c3f3 (diff) | |
| download | sphinx-151f182a2c55b9c6904475c753ee961460ef7823.tar.gz | |
Improve the handling of non-Unicode strings in the configuration:
warn about non-ascii bytestrings, and give nicer messages if unicode errors
occur.
Diffstat (limited to 'sphinx/builders/latex.py')
| -rw-r--r-- | sphinx/builders/latex.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sphinx/builders/latex.py b/sphinx/builders/latex.py index 0db30d55..eed4787d 100644 --- a/sphinx/builders/latex.py +++ b/sphinx/builders/latex.py @@ -102,7 +102,13 @@ class LaTeXBuilder(Builder): doctree.settings.title = title doctree.settings.docname = docname doctree.settings.docclass = docclass - docwriter.write(doctree, destination) + try: + docwriter.write(doctree, destination) + except UnicodeError: + self.warn("a Unicode error occurred when writing the output. " + "Please make sure all config values that contain " + "non-ASCII content are Unicode strings." % pagename) + return self.info("done") def assemble_doctree(self, indexfile, toctree_only, appendices): |
