Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 865473 Details for
Bug 1067388
Python-behave crashes when html report is created with invalid chars are present in error message
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Proposed patch
0001-html-formatter-strip-incorrect-chars-from-error-mess.patch (text/plain), 1.98 KB, created by
Vadim Rutkovsky
on 2014-02-20 11:15:51 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Vadim Rutkovsky
Created:
2014-02-20 11:15:51 UTC
Size:
1.98 KB
patch
obsolete
>From f5ffd5e581af27999c475cb3f74d69981cc758c0 Mon Sep 17 00:00:00 2001 >From: Vadim Rutkovsky <vrutkovs@redhat.com> >Date: Thu, 20 Feb 2014 12:06:25 +0100 >Subject: [PATCH] html formatter: strip incorrect chars from error message > >--- > behave/formatter/html.py | 20 ++++++++++++-------- > 1 file changed, 12 insertions(+), 8 deletions(-) > >diff --git a/behave/formatter/html.py b/behave/formatter/html.py >index a58d95b..88cb004 100644 >--- a/behave/formatter/html.py >+++ b/behave/formatter/html.py >@@ -5,6 +5,14 @@ import os.path > from behave.compat.collections import Counter > from setuptools.dist import pkg_resources > >+def _valid_XML_char_ordinal(i): >+ return ( # conditions ordered by presumed frequency >+ 0x20 <= i <= 0xD7FF >+ or i in (0x9, 0xA, 0xD) >+ or 0xE000 <= i <= 0xFFFD >+ or 0x10000 <= i <= 0x10FFFF >+ ) >+ > > class HTMLFormatter(Formatter): > name = 'html' >@@ -201,7 +209,10 @@ class HTMLFormatter(Formatter): > embed = ET.SubElement(step, 'pre', > {'id': "embed_%s" % self.embed_id, > 'style': 'display: none; white-space: pre-wrap;'}) >- embed.text = result.error_message >+ cleaned_error_message = ''.join( >+ c for c in result.error_message if valid_XML_char_ordinal(ord(c)) >+ ) >+ embed.text = cleaned_error_message > embed.tail = u' ' > > if result.status == 'failed': >@@ -266,13 +277,6 @@ class HTMLFormatter(Formatter): > caption = u'Data' > link.text = unicode(caption) > >- def valid_XML_char_ordinal(i): >- return ( # conditions ordered by presumed frequency >- 0x20 <= i <= 0xD7FF >- or i in (0x9, 0xA, 0xD) >- or 0xE000 <= i <= 0xFFFD >- or 0x10000 <= i <= 0x10FFFF >- ) > cleaned_data = ''.join( > c for c in data if valid_XML_char_ordinal(ord(c)) > ) >-- >1.8.3.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1067388
: 865473 |
876326