+
Skip to content

AttributeError for EDerivedCollection #124

Open
@fabtrie

Description

@fabtrie

I am trying to load an AUTOSAR arxml file. Therefore, I created the Ecore model from the publicly available XSD. When I try to load the resource, I am getting the following error:

File "c:\workspace\pyecore_issue\test.py", line 22, in main
    rset.get_resource(URI("test.arxml"))
  File "C:\python\3.8.1.0.7\python-3.8.1.amd64\lib\site-packages\pyecore\resources\resource.py", line 94, in get_resource
    resource.load(options=options)
  File "C:\python\3.8.1.0.7\python-3.8.1.amd64\lib\site-packages\pyecore\resources\xmi.py", line 63, in load
    self._decode_eobject(child, modelroot)
  File "C:\python\3.8.1.0.7\python-3.8.1.amd64\lib\site-packages\pyecore\resources\xmi.py", line 173, in _decode_eobject
    self._decode_eobject(child, eobject)
  File "C:\tpython\3.8.1.0.7\python-3.8.1.amd64\lib\site-packages\pyecore\resources\xmi.py", line 167, in _decode_eobject
    parent_eobj.__getattribute__(feat_container.name).append(eobject)
  File "C:\python\3.8.1.0.7\python-3.8.1.amd64\lib\_collections_abc.py", line 962, in append
    self.insert(len(self), value)
  File "C:\python\3.8.1.0.7\python-3.8.1.amd64\lib\site-packages\pyecore\valuecontainer.py", line 407, in __len__
    raise AttributeError('Operation not permited '
AttributeError: Operation not permited for "AR-PACKAGE" feature

It looks like it has something to do with the class EDerivedCollection which does not allow to get length information.

I am using pyecore version 0.12.2.

I attached a minimal example to reproduce the issue:
pyecore_issue.zip

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浏览器服务,不要输入任何密码和下载