zopefoundation / Products.CMFCore

Key framework services for the Zope Content Management Framework (CMF)
Other
6 stars 20 forks source link

Add support for Python 3.9 #103

Closed icemac closed 3 years ago

icemac commented 3 years ago

When trying to run tox -epy39 I get 47 errors which all look pretty much the same as the first one:


Error in test test_body_get (Products.CMFCore.exportimport.tests.test_actions.ActionsToolXMLAdapterTests)
Traceback (most recent call last):
  File ".../python3.9/unittest/case.py", line 59, in testPartExecutor
    yield
  File ".../python3.9/unittest/case.py", line 593, in run
    self._callTestMethod(testMethod)
  File ".../python3.9/unittest/case.py", line 550, in _callTestMethod
    method()
  File "../Products.GenericSetup-2.0.3-py3.9.egg/Products/GenericSetup/testing.py", line 85, in test_body_get
    self.assertEqual(adapted.body, self._BODY)
  File "../Products.GenericSetup-2.0.3-py3.9.egg/Products/GenericSetup/utils.py", line 525, in _exportBody
    xml = self._doc.toprettyxml(' ', encoding=self._encoding)
  File "../Products.GenericSetup-2.0.3-py3.9.egg/Products/GenericSetup/utils.py", line 437, in toprettyxml
    return Document.toprettyxml(self, indent, newl, encoding)
  File ".../python3.9/xml/dom/minidom.py", line 60, in toprettyxml
    self.writexml(writer, "", indent, newl, encoding, standalone)
TypeError: writexml() takes from 2 to 6 positional arguments but 7 were given

Maybe Products.GenericSetup has to be ported to Python 3.9 first.

dataflake commented 3 years ago

I am sure it has to. Products.GenericSetup was the greatest obstacle for the Python 3 migration as well because it is nothing but string handling and broke immediately.

icemac commented 3 years ago

Fixed in #104.