# HG changeset patch # User Goffi # Date 1686574647 -7200 # Node ID 684ba556a617032420a71590e88de08ef7e43196 # Parent c3b68fdc2de7385782a34fa242aa74c5de094d98 core (memory/sqla_mapping): fix legacy pickled values: folloing packages refactoring, legacy pickled values could not be unpickled (due to use of old classes). This temporary workaround fix it, but the right thing to do will be to move from pickle to JSON at some point. diff -r c3b68fdc2de7 -r 684ba556a617 libervia/backend/memory/sqla_mapping.py --- a/libervia/backend/memory/sqla_mapping.py Mon Jun 12 14:50:43 2023 +0200 +++ b/libervia/backend/memory/sqla_mapping.py Mon Jun 12 14:57:27 2023 +0200 @@ -102,7 +102,15 @@ except AttributeError: pass # "utf-8" encoding is needed to handle Python 2 pickled data - return pickle.loads(value, encoding="utf-8") + try: + return pickle.loads(value, encoding="utf-8") + except ModuleNotFoundError: + # FIXME: workaround due to package renaming, need to move all pickle code to + # JSON + return pickle.loads( + value.replace(b"sat.plugins", b"libervia.backend.plugins"), + encoding="utf-8" + ) class Json(TypeDecorator):