+
Skip to content

Problem during serialization (resolve URIFragment) #113

Open
@AnNeub

Description

@AnNeub

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载