Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • erp5 erp5
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 142
    • Merge requests 142
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedinexedi
  • erp5erp5
  • Merge requests
  • !2189

Fix remaining business template XML differences on py3

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Jérome Perrin requested to merge fix/py3_xml_string_oid into master Nov 07, 2025
  • Overview 2
  • Commits 15
  • Pipelines 13
  • Changes 1000+

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 str would be OK on py2, the XML was changed directly to use <string> instead of <unicode>.
    • for cases where switching to a str would 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 to MailTemplates that 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_mime on some images, which were handled by removing these obsolete attributes from the objects and re-exporting them. There was also <unicode> in PDF Template, but since PDF Template no longer works these days, the template was removed.

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.

Edited Nov 09, 2025 by Jérome Perrin
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix/py3_xml_string_oid
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7