botbuilder-python icon indicating copy to clipboard operation
botbuilder-python copied to clipboard

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

Open vbehar opened this issue 6 months ago • 0 comments

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:

  • https://github.com/microsoft/teams-ai/issues/2547
  • https://github.com/microsoft/teams-ai/issues/2510

The issue has been introduced in botbuilder-python v4.17.0 in this PR: https://github.com/microsoft/botbuilder-python/pull/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

vbehar avatar Aug 05 '25 10:08 vbehar