Your message dated Sun, 25 Aug 2019 15:38:03 +0000
with message-id <[email protected]>
and subject line Bug#935688: Removed package(s) from unstable
has caused the Debian Bug report #739922,
regarding xmlrunner does not support ]]> in error messages and std{out/err}
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
739922: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739922
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: python-xmlrunner
Version: 1.5.0-1
Severity: normal
Tags: upstream patch
Forwarded: https://github.com/danielfm/unittest-xml-reporting/issues/48
Following simple test snippet:
---8<--- [cut] ---8<---
#!/usr/bin/env python
import unittest
import xmlrunner
class Foo(unittest.TestCase):
def testFoo(self):
self.assertTrue(False, ']]>')
unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports'))
---8<--- [cut] ---8<---
results with unhandled exception:
ValueError: ']]>' not allowed in a CDATA section
Multiple CDATA sections can be added in a manner that will result with
following final output:
---8<--- [cut] ---8<---
<error message="]]>" type="AssertionError">
<![CDATA[Traceback (most recent call last):
File "./t.py", line 7, in testFoo
self.assertTrue(False, ']]]]><![CDATA[>')
AssertionError: ]]]]><![CDATA[>
]]> </error>
---8<--- [cut] ---8<---
-- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.12-1-amd64 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages python-xmlrunner depends on:
ii python 2.7.5-5
Versions of packages python-xmlrunner recommends:
pn python-unittest2 <none>
python-xmlrunner suggests no packages.
-- no debconf information
--
zaoszczędzona benzyna napędza motory tak samo dobrze, jak zaoszczędzony cement
wiąże zaoszczędzone cegły
/"Przygoda na Mariensztacie"/
diff --git a/src/xmlrunner/__init__.py b/src/xmlrunner/__init__.py
index 2ce86d5..5aab83a 100644
--- a/src/xmlrunner/__init__.py
+++ b/src/xmlrunner/__init__.py
@@ -268,6 +268,20 @@ class _XMLTestResult(_TextTestResult):
_test_method_name = staticmethod(_test_method_name)
+ def _createCDATAsections(xmldoc, node, text):
+ pos = text.find(']]>')
+ while pos >= 0:
+ tmp=text[0:pos+2]
+ cdata = xmldoc.createCDATASection(tmp)
+ node.appendChild(cdata)
+ text=text[pos+2:]
+ pos = text.find(']]>')
+ cdata = xmldoc.createCDATASection(text)
+ node.appendChild(cdata)
+
+ _createCDATAsections = staticmethod(_createCDATAsections)
+
+
def _report_testcase(suite_name, test_result, xml_testsuite, xml_document):
"""
Appends a testcase section to the XML document.
@@ -289,8 +303,7 @@ class _XMLTestResult(_TextTestResult):
failure.setAttribute('type', test_result.err[0].__name__)
failure.setAttribute('message', str(test_result.err[1]))
error_info = str(test_result.get_error_info())
- failureText = xml_document.createCDATASection(error_info)
- failure.appendChild(failureText)
+ _XMLTestResult._createCDATAsections(xml_document, failure, error_info)
else:
failure.setAttribute('type', 'skip')
failure.setAttribute('message', test_result.err)
@@ -305,14 +318,12 @@ class _XMLTestResult(_TextTestResult):
systemout = xml_document.createElement('system-out')
xml_testsuite.appendChild(systemout)
- systemout_text = xml_document.createCDATASection(sys.stdout.getvalue())
- systemout.appendChild(systemout_text)
+ _XMLTestResult._createCDATAsections(xml_document, systemout, sys.stdout.getvalue())
systemerr = xml_document.createElement('system-err')
xml_testsuite.appendChild(systemerr)
- systemerr_text = xml_document.createCDATASection(sys.stderr.getvalue())
- systemerr.appendChild(systemerr_text)
+ _XMLTestResult._createCDATAsections(xml_document, systemerr, sys.stderr.getvalue())
_report_output = staticmethod(_report_output)
--- End Message ---
--- Begin Message ---
Version: 1.5.0-1+rm
Dear submitter,
as the package unittest-xml-reporting has just been removed from the Debian
archive
unstable we hereby close the associated bug reports. We are sorry
that we couldn't deal with your issue properly.
For details on the removal, please see https://bugs.debian.org/935688
The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.
This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
[email protected].
Debian distribution maintenance software
pp.
Scott Kitterman (the ftpmaster behind the curtain)
--- End Message ---
_______________________________________________
Python-modules-team mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/python-modules-team