Fix XML memory cleanup.
See 4.11 of https://docs.google.com/spreadsheets/d/1lQJzSIE6iUhlRQ5O4gjHBnIpsqFS7w3DQw3wX5_66P8/edit#gid=1881169084
Changes
This MR primarily updates our XML readers to fix an issue where the xml library was cleaned up too often (It should be run only once before exiting).
It also includes:
- Changes due to other dependencies, such as types switching to uints and table column updates.
- Adds a function for repeated code.
- Improved debug to assist with any future table column changes.
- Removes calls to 'xmlMemoryDump' which dumps memory to disk.
References
- https://0pointer.net/blog/projects/beware-of-xmlCleanupParser.html
- https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlCleanupParser
- https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlmemory.html#xmlMemoryDump
This repeats all changes from !226 (closed) for these files.
Purpose
I intend to split !226 (closed)'s changes into a number of MRs, which won't be functional code versions themselves, but once complete will encompass the full set of changes to upgrade to py3.
This should provide useful code diffs for reviewers.