Skip to content

AttributeError: 'dict' object has no attribute 'is_xml_model' #2235

@vbehar

Description

@vbehar

Version

v4.17.0

Describe the bug

Sending a "feedback" to a bot in Teams generates the following error:

Traceback (most recent call last):
File "/.../.venv/lib/python3.12/site-packages/msrest/serialization.py", line 494, in _serialize
is_xml_model_serialization = kwargs["is_xml"]
~~~~~~^^^^^^^^^^
KeyError: 'is_xml'

During handling of the above exception, another exception occurred:

[...]

File "/.../.venv/lib/python3.12/site-packages/botbuilder/core/serializer_helper.py", line 40, in serializer_helper
return serializer._serialize(object_to_serialize)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.../.venv/lib/python3.12/site-packages/msrest/serialization.py", line 496, in _serialize
is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model())
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'is_xml_model'

To Reproduce

Steps to reproduce the behavior:

  1. Install a python sample app from https://github.com/OfficeDev/microsoft-365-agents-toolkit
  2. Run the bot, make it answer something
  3. Try to send a feedback to the bot
  4. See error

Expected behavior

no failure ;-)

Additional context

Original bug reports have been reported in the https://github.com/microsoft/teams-ai/ repo:

The issue has been introduced in botbuilder-python v4.17.0 in this PR: #2226 - and more precisely in the cloud_adapter by using a serializer_helper on a dict - which has no 'is_xml_model' attribute: https://github.com/microsoft/botbuilder-python/pull/2226/files#diff-0de1897f504beeb3a3573d1e89fd20ad5d42a8a33d779b341e253527a638da07

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or an unintended behavior.needs-triageThe issue has just been created and it has not been reviewed by the team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions