[Zope3-checkins] CVS: Zope3/src/zope/exceptions - exceptionformatter.py:1.6

Guido van Rossum guido@python.org
Mon, 21 Apr 2003 16:11:50 -0400


Update of /cvs-repository/Zope3/src/zope/exceptions
In directory cvs.zope.org:/tmp/cvs-serv11695

Modified Files:
	exceptionformatter.py 
Log Message:
Show the "extra info" from __traceback_supplement__ with spaces and
newlines replaced by &nbsp; and <br>, respectively.


=== Zope3/src/zope/exceptions/exceptionformatter.py 1.5 => 1.6 ===
--- Zope3/src/zope/exceptions/exceptionformatter.py:1.5	Mon Apr 21 16:06:13 2003
+++ Zope3/src/zope/exceptions/exceptionformatter.py	Mon Apr 21 16:11:49 2003
@@ -99,7 +99,11 @@
             try:
                 extra = getInfo()
                 if extra:
-                    result.append(self.escape(extra))
+                    extra = self.escape(extra)
+                    if self.line_sep != "\n":
+                        extra = extra.replace(" ", "&nbsp;")
+                        extra = extra.replace("\n", self.line_sep)
+                    result.append(extra)
             except:
                 if DEBUG_EXCEPTION_FORMATTER:
                     import traceback