From 0e75db370dfab7931fbd9a0318507ce31a9f364f Mon Sep 17 00:00:00 2001 From: ale-rt Date: Wed, 16 Sep 2020 17:00:25 +0200 Subject: [PATCH] ZODBReference is now callable to fix an unpickling error Fixes #20 --- CHANGES.rst | 3 +++ src/zodbupdate/serialize.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 7a76e27..5dc6516 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,9 @@ Changes 1.6 (unreleased) ---------------- +- ZODBReference is now callable to fix an unpickling error. + (`#20 `__) + - Test with history-free and history-preserving RelStorage. Note that history-preserving RelStorage requires RelStorage 3.3 or above, and Python 2.7 or Python 3.6 and above. diff --git a/src/zodbupdate/serialize.py b/src/zodbupdate/serialize.py index ceaca5c..c5b9ba2 100644 --- a/src/zodbupdate/serialize.py +++ b/src/zodbupdate/serialize.py @@ -133,6 +133,11 @@ class ZODBReference(object): def __init__(self, ref): self.ref = ref + def __call__(self): + """ We need an empty __call__ + """ + pass + class ObjectRenamer(object): """This load and save a ZODB record, modifying all references to