From: <fwi...@us...> - 2006-09-16 21:32:33
|
Author: fwiemann Date: 2006-09-16 23:32:29 +0200 (Sat, 16 Sep 2006) New Revision: 4750 Modified: trunk/docutils/HISTORY.txt trunk/docutils/THANKS.txt trunk/docutils/docutils/io.py Log: added support for IronPython 1.0 (thanks to Seo Sanghyeon); closing http://sf.net/tracker/?func=detail&atid=422032&aid=1550267&group_id=38414 Modified: trunk/docutils/HISTORY.txt =================================================================== --- trunk/docutils/HISTORY.txt 2006-09-16 21:20:11 UTC (rev 4749) +++ trunk/docutils/HISTORY.txt 2006-09-16 21:32:29 UTC (rev 4750) @@ -26,6 +26,7 @@ - Added code to determine the input encoding from data: encoding declarations or the presence of byte order marks (UTF-8 & UTF-16). + - Added support for IronPython 1.0. * docutils/nodes.py: Modified: trunk/docutils/THANKS.txt =================================================================== --- trunk/docutils/THANKS.txt 2006-09-16 21:20:11 UTC (rev 4749) +++ trunk/docutils/THANKS.txt 2006-09-16 21:32:29 UTC (rev 4750) @@ -141,6 +141,7 @@ * Laurence Tratt * Adrian van den Dries * Guido van Rossum +* Seo Sanghyeon * Miroslav Vasko * Paul Viren * Martin von Loewis Modified: trunk/docutils/docutils/io.py =================================================================== --- trunk/docutils/docutils/io.py 2006-09-16 21:20:11 UTC (rev 4749) +++ trunk/docutils/docutils/io.py 2006-09-16 21:32:29 UTC (rev 4750) @@ -197,13 +197,14 @@ else: try: return data.encode(self.encoding, self.error_handler) - except ValueError: - # ValueError is raised if there are unencodable chars - # in data and the error_handler isn't found. + except (LookupError, ValueError): + # LookupError is raised if there are unencodable chars + # in data and the error_handler isn't found. In old + # Python versions, ValueError is raised. if self.error_handler == 'xmlcharrefreplace': # We are using xmlcharrefreplace with a Python - # version that doesn't support it (2.1 or 2.2), so - # we emulate its behavior. + # version that doesn't support it (2.1, 2.2, or + # IronPython 1.0) so we emulate its behavior. return ''.join([self.xmlcharref_encode(char) for char in data]) else: |