Description
I have loaded a resource set which consists of two resource files. I did some modification in one file and than I store it again.
This was already working but suddenly it dont work any more. When i dive into the code, I found out the following:
As far as I understood, during loading of the first resource file an EProxy is generated for the link to an object into the other resource file. When loading the second resource the dedicated object is created and linked to the EProxy.
During serialization of the second resource, an error occur in the function eURIFragment.
The problem in my case was that parent.__getattribute__(name).index(self)
raises an IndexError. The parent seems to be part of the first resource and therefore an EProxy object is part of the Orderset. But self
is the dedicated object and therefore could not be found.
If I try to determine the index via a loop like this
for idx, element in enumerate(parent.__getattribute__(name)):
if isinstance(element, EProxy) and not isinstance(self, EProxy):
if self == element._wrapped:
index = idx
break
else:
if self == element:
index = idx
break
it works.
I don't know if this case could be captured at the beginning of the function. I'm wondering why this was working if I have done less modification.
If you need more information, please let me know.
Best regards,
Andreas