I still do not fully understand this custom behavior, but I know where it occurs:
if "handle" in attrs:
...
else: # old style XML
self.inaugurate_id(attrs.get("id"), SOURCE_KEY, self.source)
File "/usr/lib/python3/dist-packages/gramps/gui/dbloader.py", line 531, in do_import
dbstate=self.dbstate,
File "/usr/lib/python3/dist-packages/gramps/plugins/importer/importxml.py", line 204, in importData
info = parser.parse(xml_file, line_cnt, person_cnt)
File "/usr/lib/python3/dist-packages/gramps/plugins/importer/importxml.py", line 1063, in parse
self.p.ParseFile(ifile)
File "/usr/lib/python3/dist-packages/gramps/plugins/importer/importxml.py", line 3354, in startElement
f(attrs)
File "/usr/lib/python3/dist-packages/gramps/plugins/importer/importxml.py", line 2336, in start_source
and maybe why:
2025-03-15 16:56:03.887: ERROR: dbloader.py: line 548: Failed to import database.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/gramps/gui/dbloader.py", line 531, in do_import
dbstate=self.dbstate,
File "/usr/lib/python3/dist-packages/gramps/plugins/importer/importxml.py", line 204, in importData
info = parser.parse(xml_file, line_cnt, person_cnt)
File "/usr/lib/python3/dist-packages/gramps/plugins/importer/importxml.py", line 1063, in parse
self.p.ParseFile(ifile)
File "../Modules/pyexpat.c", line 473, in EndElement
File "/usr/lib/python3/dist-packages/gramps/plugins/importer/importxml.py", line 3360, in endElement
self.func("".join(self.tlist))
File "/usr/lib/python3/dist-packages/gramps/plugins/importer/importxml.py", line 3092, in stop_source
self.db.commit_source(self.source, self.trans, self.source.get_change_time())
File "/usr/lib/python3/dist-packages/gramps/gen/db/generic.py", line 2023, in commit_source
self._commit_base(source, SOURCE_KEY, trans, change_time)
File "/usr/lib/python3/dist-packages/gramps/plugins/db/dbapi/dbapi.py", line 661, in _commit_base
self.dbapi.execute(sql, [obj.handle, pickle.dumps(obj.serialize())])
File "/usr/lib/python3/dist-packages/gramps/plugins/db/dbapi/sqlite.py", line 136, in execute
self.__cursor.execute(*args, **kwargs)
sqlite3.IntegrityError: NOT NULL constraint failed: source.handle
but it should not be specific (custom error) to source object. All primary objects have the same code. So, I should get (gramps 5.2.x, not tested on gramps 6.0 beta) the same limitations on place and people?