altdesktop / python-dbus-next

🚌 The next great DBus library for Python with asyncio support
https://python-dbus-next.readthedocs.io/en/latest/
MIT License
199 stars 59 forks source link

properties must have a single complete type. #167

Open dakhnod opened 1 week ago

dakhnod commented 1 week ago

hi, thanks for your work!

For the attached property, I get the following error

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/quart/app.py", line 1403, in handle_request
    return await self.full_dispatch_request(request_context)
  File "/usr/local/lib/python3.10/dist-packages/quart/app.py", line 1441, in full_dispatch_request
    result = await self.handle_user_exception(error)
  File "/usr/local/lib/python3.10/dist-packages/quart/app.py", line 1029, in handle_user_exception
    raise error
  File "/usr/local/lib/python3.10/dist-packages/quart/app.py", line 1439, in full_dispatch_request
    result = await self.dispatch_request(request_context)
  File "/usr/local/lib/python3.10/dist-packages/quart/app.py", line 1535, in dispatch_request
    return await self.ensure_async(handler)(**request_.view_args)  # type: ignore
  File "/usr/local/lib/python3.10/dist-packages/http_dbus_gateway/__init__.py", line 96, in inspect_bus
    await introspect_path()
  File "/usr/local/lib/python3.10/dist-packages/http_dbus_gateway/__init__.py", line 94, in introspect_path
    await introspect_path(f'{path}/{node.name}')
  File "/usr/local/lib/python3.10/dist-packages/http_dbus_gateway/__init__.py", line 94, in introspect_path
    await introspect_path(f'{path}/{node.name}')
  File "/usr/local/lib/python3.10/dist-packages/http_dbus_gateway/__init__.py", line 94, in introspect_path
    await introspect_path(f'{path}/{node.name}')
  [Previous line repeated 1 more time]
  File "/usr/local/lib/python3.10/dist-packages/http_dbus_gateway/__init__.py", line 50, in introspect_path
    introspection = await connection.introspect(bus, '/' if path == '' else path)
  File "/usr/local/lib/python3.10/dist-packages/dbus_next/aio/message_bus.py", line 216, in introspect
    return await asyncio.wait_for(future, timeout=timeout)
  File "/usr/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.10/dist-packages/dbus_next/message_bus.py", line 196, in reply_notify
    result = intr.Node.parse(reply.body[0])
  File "/usr/local/lib/python3.10/dist-packages/dbus_next/introspection.py", line 437, in parse
    return Node.from_xml(element, is_root=True)
  File "/usr/local/lib/python3.10/dist-packages/dbus_next/introspection.py", line 414, in from_xml
    node.interfaces.append(Interface.from_xml(child))
  File "/usr/local/lib/python3.10/dist-packages/dbus_next/introspection.py", line 341, in from_xml
    interface.properties.append(Property.from_xml(child))
  File "/usr/local/lib/python3.10/dist-packages/dbus_next/introspection.py", line 274, in from_xml
    return Property(name, signature, access)
  File "/usr/local/lib/python3.10/dist-packages/dbus_next/introspection.py", line 246, in __init__
    raise InvalidIntrospectionError(
dbus_next.errors.InvalidIntrospectionError: properties must have a single complete type. (has 8 types)
    <property name="MdnsTelemetryInfo" type="(uuuuuuuu)(uuuuuuuu)(uuuuuuuu)(uuuuuuuu)uuuu" access="read">
      <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/>
    </property>

Is this an error with the parser or the spec?

dakhnod commented 1 week ago

Okay, I see, dbus_next would only allow a single complete type as property type. Is this from the dbus spec? I cannot seem to find that anywhere...