1 Home
Frederik Jaeckel edited this page 2024-12-12 12:54:30 +00:00

Factur-x verwendet aus der Python-lib importlib.resources die Funktion files. Diese gibt es in Python 3.8 nicht. Als Workaround kann man das umbauen:

import pathlib
package_path = pathlib.PosixPath('/'.join(__file__.split('/')[:-1] + [xsd_file]))
xsd_etree_obj = etree.parse(package_path.open())
#    xsd_etree_obj = etree.parse(importlib.resources.files(__package__)
#        .joinpath(xsd_file).open())