0
0
Fork 0

fix: import_xml is reporter-first on SP21 -- all-keyword call

Same overload drift as export_xml: positional (path, None, folders) put
the path string in the reporter slot ('expected IImportReporter, got
str'). All args now passed by keyword with positional fallback.
This commit is contained in:
Karstein Phobic Nyvold Kvistad 2026-06-12 15:24:32 +02:00
parent 80ba96aae7
commit 29736e2963

View file

@ -10,7 +10,15 @@ try:
if not IMPORT_PATH or not os.path.isfile(IMPORT_PATH):
raise ValueError("Import file does not exist: %s" % IMPORT_PATH)
primary_project.import_xml(IMPORT_PATH, None, IMPORT_FOLDER_STRUCTURE)
# ALL arguments by keyword: SP21's runtime overload is reporter-first
# (stub documents dataOrPath-first), so positional args land in the
# wrong slots depending on SP.
try:
primary_project.import_xml(dataOrPath=IMPORT_PATH, reporter=None,
import_folder_structure=IMPORT_FOLDER_STRUCTURE)
except TypeError as sig_err:
print("DEBUG: full-keyword call failed (%s); retrying stub positional order." % sig_err)
primary_project.import_xml(IMPORT_PATH, None, IMPORT_FOLDER_STRUCTURE)
primary_project.save()
print("DEBUG: import_xml + save OK")