[Epydoc-commits] SF.net SVN: epydoc: [1716] trunk/epydoc/src/epydoc/docwriter/html_colorize. py
Brought to you by:
edloper
From: <ed...@us...> - 2008-02-14 22:21:25
|
Revision: 1716 http://epydoc.svn.sourceforge.net/epydoc/?rev=1716&view=rev Author: edloper Date: 2008-02-14 14:21:23 -0800 (Thu, 14 Feb 2008) Log Message: ----------- - If the source file is not encoded correctly, then recover as well as we can, and issue a warning. Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/html_colorize.py Modified: trunk/epydoc/src/epydoc/docwriter/html_colorize.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html_colorize.py 2008-02-13 19:19:47 UTC (rev 1715) +++ trunk/epydoc/src/epydoc/docwriter/html_colorize.py 2008-02-14 22:21:23 UTC (rev 1716) @@ -488,6 +488,12 @@ except LookupError: coding = 'iso-8859-1' html = html.decode(coding).encode('ascii', 'xmlcharrefreplace') + except UnicodeDecodeError, e: + log.warning("Unicode error while generating syntax-highlighted " + "source code: %s (%s)" % (e, self.module_filename)) + html = html.decode(coding, 'ignore').encode( + 'ascii', 'xmlcharrefreplace') + # Call expandto. html += PYSRC_EXPANDTO_JAVASCRIPT This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |