XMLExportImport: support python3
This includes heuristics to guess the str or bytes from business template XML: oids are bytes and also some strings that do not decode to UTF-8, so that we can install python2 business templates on py3. When exporting business templates, we need to build a list of referenced persistent objects to export them separately in the XML, this is is done using noload, in a way which does not support pickle protocol 1 on py3 (the persistent ids are None and the assertion in https://github.com/zopefoundation/ZODB/blob/d698507bb89eeb38c6e655199bc9f54c909dbf4d/src/ZODB/serialize.py#L669 fails), so we need to use pickle protocol 3 on py3. With these changes, on py2 we are still using the same protocol 1 and the output is stable, but on py3 we are using protocol 3 and the output is different. Business template exported on py This also adds some test coverage of XMLExportImport, while doing this it was found that the ad-hoc handling of boolean in protocol 1 was not implemented correctly and they were serialized as integers (0 for False and 1 for True), this is also fixed.
Status | Job ID | Name | Coverage | ||||||
---|---|---|---|---|---|---|---|---|---|
External | |||||||||
passed |
#702904
external
|
ERP5.CodingStyleTest-Zope4Py3 |
01:27:32
|
||||||
failed |
#702896
external
|
ERP5.UnitTest-Zope4Py3 |
01:40:34
|
||||||
failed |
#707946
external
|
ERP5.UnitTest-Zope4Py3-jerome |
03:52:55
|
||||||
failed |
#709869
external
|
ERP5.UnitTest-Zope4Py3-py2-jerome |
04:11:14
|
||||||
failed |
#702897
external
retried
|
ERP5.UnitTest-Zope4Py3-jerome |
03:38:58
|
||||||
failed |
#707620
external
retried
|
ERP5.UnitTest-Zope4Py3-jerome |
05:09:55
|
||||||
failed |
#707133
external
retried
|
ERP5.UnitTest-Zope4Py3-jerome |
09:11:06
|
||||||
failed |
#706951
external
retried
|
ERP5.UnitTest-Zope4Py3-jerome |
06:22:43
|
||||||
failed |
#706838
external
retried
|
ERP5.UnitTest-Zope4Py3-jerome |
04:49:22
|
||||||
failed |
#706703
external
retried
|
ERP5.UnitTest-Zope4Py3-jerome |
05:25:11
|
||||||
failed |
#706607
external
retried
|
ERP5.UnitTest-Zope4Py3-jerome |
05:09:28
|
||||||
failed |
#706263
external
retried
|
ERP5.UnitTest-Zope4Py3-jerome |
03:18:17
|
||||||
failed |
#706146
external
retried
|
ERP5.UnitTest-Zope4Py3-jerome |
04:03:59
|
||||||
failed |
#705370
external
retried
|
ERP5.UnitTest-Zope4Py3-jerome |
05:06:00
|
||||||
failed |
#704594
external
retried
|
ERP5.UnitTest-Zope4Py3-jerome |
05:21:47
|
||||||
failed |
#704499
external
retried
|
ERP5.UnitTest-Zope4Py3-jerome |
04:21:45
|
||||||
failed |
#704383
external
retried
|
ERP5.UnitTest-Zope4Py3-jerome |
04:15:53
|
||||||
failed |
#703071
external
retried
|
ERP5.UnitTest-Zope4Py3-jerome |
09:06:20
|
||||||
passed |
#702894
external
retried
|
ERP5.UnitTest-Zope4Py3-py2-jerome |
02:10:02
|
||||||