[Python-modules-team] Bug#739922: xmlrunner does not support ]]> in error messages and std{out/err}

Artur R. Czechowski arturcz at hell.pl
Sun Feb 23 23:22:48 UTC 2014


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"/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cdata.patch
Type: text/x-diff
Size: 2283 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20140224/c5ad9552/attachment-0001.patch>


More information about the Python-modules-team mailing list