You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error
Traceback (most recent call last):
File "/Users/nicolasfortin/.pyenv/versions/3.7.9/lib/python3.7/unittest/case.py", line 59, in testPartExecutor
yield
File "/Users/nicolasfortin/.pyenv/versions/3.7.9/lib/python3.7/unittest/case.py", line 628, in run
testMethod()
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/components/be_core/claim_management/services/assur_card/tests/test_assur_card_parser.py", line 45, in test_parse_assur_pharma_file_invoice
invoice = AssurCardParser.parse_assur_pharma_file_invoice(f.read())
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/components/be_core/claim_management/services/assur_card/assur_card_parser.py", line 63, in parse_assur_pharma_file_invoice
return parser.from_string(invoice, SingleMessage)
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/bindings.py", line 24, in from_string
return self.from_bytes(source.encode(), clazz)
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/bindings.py", line 28, in from_bytes
return self.parse(io.BytesIO(source), clazz)
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/dataclass/parsers/nodes.py", line 464, in parse
result = handler.parse(source)
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/dataclass/parsers/handlers/lxml.py", line 37, in parse
return self.process_context(ctx)
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/dataclass/parsers/handlers/lxml.py", line 50, in process_context
element.nsmap,
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/dataclass/parsers/xml.py", line 46, in start
super().start(clazz, queue, objects, qname, attrs, ns_map)
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/dataclass/parsers/nodes.py", line 483, in start
child = item.child(qname, attrs, ns_map, len(objects))
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/dataclass/parsers/nodes.py", line 114, in child
node = self.build_node(var, attrs, ns_map, position)
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/dataclass/parsers/nodes.py", line 136, in build_node
var.clazz, attrs, ns_map, position, var.derived
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/dataclass/parsers/nodes.py", line 191, in build_element_node
meta = self.context.fetch(clazz, self.meta.namespace, xsi_type)
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/dataclass/context.py", line 67, in fetch
subclass = self.find_subclass(clazz, xsi_type)
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/dataclass/context.py", line 111, in find_subclass
types = self.find_types(qname)
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/dataclass/context.py", line 95, in find_types
self.build_xsi_cache()
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/dataclass/context.py", line 75, in build_xsi_cache
for clazz in self.get_subclasses(object):
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/dataclass/context.py", line 360, in get_subclasses
yield subclass
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/dataclass/context.py", line 360, in get_subclasses
yield subclass
File "/Users/nicolasfortin/Workspaces/Alan/alan-backend/.venv/lib/python3.7/site-packages/xsdata/formats/dataclass/context.py", line 359, in get_subclasses
yield from cls.get_subclasses(subclass)
TypeError: descriptor '__subclasses__' of 'type' object needs an argument
The text was updated successfully, but these errors were encountered:
Hi @zallek thanks for reporting, I just released a fix to catch all type errors when its building the xsi cache.
Unfortunately I failed to reproduced it correctly, can you share more info like your other project dependencies and os.
I created a venv with python 3.7.9, installed the flask-sqlalchemy and imported the module you mentioned in one of the tests that's triggering the xsi cache rebuild but I didn't get the exception, the previous check in that method actually worked as it was supposed to.
Hi,
I have a
TypeError
when I try to upgrade thexsdata
from 20.10 to 20.11.We use python
3.7.9
With the
20.11
, the lib is falling to get the subclasses of the following classhttps://github.com/pallets/flask-sqlalchemy/blob/9876d6c0ec3ac3390f739bb3eb3ea5ab4c0905b7/src/flask_sqlalchemy/model.py#L121
The trackback
The text was updated successfully, but these errors were encountered: