From 89eafb8816d59140cd764c8b01496edd418ceb79 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 28 Nov 2019 12:29:41 +0100 Subject: [PATCH] formdata: do not modify __dict__ in __getstate__ (#38049) It suppress the _formdef cache, which can break things with transient formdata created from the FormData class instead of a FormDef.data_class(). Ideally transient FormData should be never copied as the copy is lacking a _formdef attribute and _names is not initialised so FormData.get_formdef() will never work. --- wcs/formdata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcs/formdata.py b/wcs/formdata.py index 5688924f..f4372634 100644 --- a/wcs/formdata.py +++ b/wcs/formdata.py @@ -1106,7 +1106,7 @@ class FormData(StorableObject): # don't pickle _formdef cache def __getstate__(self): - odict = self.__dict__ + odict = self.__dict__.copy() if '_formdef' in odict: del odict['_formdef'] return odict -- 2.23.0