This addresses all the remaining business template differences on py3, so that the XML representation of all ERP5 business templates currently covered by coding style tests are the same on py2 and py3.
The remaining problems were:
- only persistent_id of direct reference was
<bytes>, indirect references were often still<string>. - some small low-level differences, such as empty object states or re flags
- the remaining cases of
<unicode>, which no longer exist in py2. There were different cases:- for cases where a
strwould be OK on py2, the XML was changed directly to use<string>instead of<unicode>. - for cases where switching to a
strwould change the behavior, or cases where it would still be exported as<unicode>, adjust business template to special case the objects. This was the case for title of page templates, or toMailTemplatesthat we now export as a separate file, as a way to keep using an unicode for_text. - there were also a few cases of
<unicode>in some unknown/obsolete_cached_mimeon some images, which were handled by removing these obsolete attributes from the objects and re-exporting them. There was also<unicode>inPDF Template, but sincePDF Templateno longer works these days, the template was removed.
- for cases where a
This also addresses a potential problem from 699a2836 (XMLExportImport: export
business templates with pickle protocol 3., 2025-10-16) and 2263917a (*: re-export
business templates, 2025-10-16), which caused some document properties, typically
File.data to become zodbpickle.binary instances on py2 - and zodbpickle.binary
are not allowed in restricted python. To prevent some unexpected unauthorized errors
when such an object is accessed from restricted python, we allow access to this class,
it is just a str subclass.