Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.63k stars 2.84k forks source link

Unable to Pickle ServiceBus Message Object #12902

Closed dgokeeffe closed 4 years ago

dgokeeffe commented 4 years ago

Describe the bug When attempting to pickle.dump() an array of Message objects a TypeError is raised.

To Reproduce Steps to reproduce the behavior:

  1. Attempt to pickle a Message object

Expected behavior The object is pickled correctly

Screenshots

import pickle
from azure.servicebus import Message

msgs = [Message(body={"test"})]
pickle.dump(msgs, open("./dump", "wb")
File "stringsource", line 2, in uamqp.c_uamqp.StringValue.__reduce_cython__
TypeError: no default __reduce__ due to non-trivial __cinit__
lmazuel commented 4 years ago

Closing as duplicate of https://github.com/Azure/azure-sdk-for-python/issues/12901