Commit 252cd0e4 authored by R David Murray's avatar R David Murray

#12890: don't emit <p> tags in text mode when logdir specified.

Patch by Jeff McNeil.
parent bc876a2d
...@@ -293,14 +293,19 @@ class Hook: ...@@ -293,14 +293,19 @@ class Hook:
if self.logdir is not None: if self.logdir is not None:
suffix = ['.txt', '.html'][self.format=="html"] suffix = ['.txt', '.html'][self.format=="html"]
(fd, path) = tempfile.mkstemp(suffix=suffix, dir=self.logdir) (fd, path) = tempfile.mkstemp(suffix=suffix, dir=self.logdir)
try: try:
file = os.fdopen(fd, 'w') file = os.fdopen(fd, 'w')
file.write(doc) file.write(doc)
file.close() file.close()
msg = '<p> %s contains the description of this error.' % path msg = '%s contains the description of this error.' % path
except: except:
msg = '<p> Tried to save traceback to %s, but failed.' % path msg = 'Tried to save traceback to %s, but failed.' % path
self.file.write(msg + '\n')
if self.format == 'html':
self.file.write('<p>%s</p>\n' % msg)
else:
self.file.write(msg + '\n')
try: try:
self.file.flush() self.file.flush()
except: pass except: pass
......
...@@ -699,6 +699,7 @@ Mark Mc Mahon ...@@ -699,6 +699,7 @@ Mark Mc Mahon
Gordon McMillan Gordon McMillan
Caolan McNamara Caolan McNamara
Andrew McNamara Andrew McNamara
Jeff McNeil
Craig McPheeters Craig McPheeters
Lambert Meertens Lambert Meertens
Bill van Melle Bill van Melle
......
...@@ -132,6 +132,9 @@ Core and Builtins ...@@ -132,6 +132,9 @@ Core and Builtins
Library Library
------- -------
- Issue #12890: cgitb no longer prints spurious <p> tags in text
mode when the logdir option is specified.
- Issue #16250: Fix URLError invocation with proper args. - Issue #16250: Fix URLError invocation with proper args.
- Issue #16305: Fix a segmentation fault occurring when interrupting - Issue #16305: Fix a segmentation fault occurring when interrupting
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment