Hello community,

here is the log from the commit of package python-docutils for openSUSE:Factory 
checked in at 2019-10-14 14:53:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-docutils (Old)
 and      /work/SRC/openSUSE:Factory/.python-docutils.new.2352 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-docutils"

Mon Oct 14 14:53:14 2019 rev:28 rq:737543 version:0.15.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-docutils/python-docutils.changes  
2019-09-23 12:17:44.101803569 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-docutils.new.2352/python-docutils.changes    
    2019-10-14 14:53:15.786174107 +0200
@@ -1,0 +2,7 @@
+Fri Oct 11 14:11:49 CEST 2019 - Matej Cepl <[email protected]>
+
+- Add fix_tests_38.patch to overcome failing
+  test_writers.test_odt.DocutilsOdtTestCase with Python 3.8.
+  Also, failed as shp#docutils#161.
+
+-------------------------------------------------------------------

New:
----
  fix_tests_38.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-docutils.spec ++++++
--- /var/tmp/diff_new_pack.wIr0m2/_old  2019-10-14 14:53:16.690171750 +0200
+++ /var/tmp/diff_new_pack.wIr0m2/_new  2019-10-14 14:53:16.694171739 +0200
@@ -34,6 +34,9 @@
 URL:            https://pypi.python.org/pypi/docutils/
 Source:         
https://files.pythonhosted.org/packages/source/d/docutils/docutils-%{version}.tar.gz
 Source99:       python-docutils-rpmlintrc
+# PATCH-FIX-UPSTREAM fix_tests_38.patch shp#docutils#161 [email protected]
+# Fixes failing tests in test_writers.test_odt.DocutilsOdtTestCase
+Patch0:         fix_tests_38.patch
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module xml}
 BuildRequires:  fdupes
@@ -63,6 +66,7 @@
 
 %prep
 %setup -q -n docutils-%{version}
+%autopatch -p1
 # Remove useless ".py" ending from executables:
 for i in tools/rst*; do mv "$i" "${i/.py}"; done
 sed -i "s|'tools/\(rst.*\)\.py'|'tools/\1'|" setup.py

++++++ fix_tests_38.patch ++++++
--- a/test/test_writers/test_odt.py
+++ b/test/test_writers/test_odt.py
@@ -80,7 +80,7 @@ class DocutilsOdtTestCase(DocutilsTestSu
                     sys.stderr.write(s1)
         return WhichElementTree
 
-    def process_test(self, input_filename, expected_filename, 
+    def process_test(self, input_filename, expected_filename,
             save_output_name=None, settings_overrides=None):
         if not self.check_import():
             return
@@ -112,19 +112,22 @@ class DocutilsOdtTestCase(DocutilsTestSu
             outfile.close()
         content1 = self.extract_file(result, 'content.xml')
         content2 = self.extract_file(expected, 'content.xml')
-        msg = 'content.xml not equal: expected len: %d  actual len: %d' % (
-            len(content2), len(content1), )
-        self.assertEqual(content1, content2, msg)
+        # self.assertEqual(content1, content2, msg)
+        self.assertEqual(content1, content2)
 
     def extract_file(self, payload, filename):
+        from xml.etree import ElementTree as etree
         payloadfile = BytesIO()
         payloadfile.write(payload)
         payloadfile.seek(0)
         zfile = zipfile.ZipFile(payloadfile, 'r')
         content1 = zfile.read(filename)
-        doc = minidom.parseString(content1)
-        #content2 = doc.toprettyxml(indent='  ')
-        content2 = doc.toxml()
+        if hasattr(etree, 'canonicalize'):
+            content2 = etree.canonicalize(content1, with_comments=True)
+        else:
+            #content2 = doc.toprettyxml(indent='  ')
+            doc = minidom.parseString(content1)
+            content2 = doc.toxml()
         return content2
 
     def assertEqual(self, first, second, msg=None):

Reply via email to