hey there - yes this is unfortunately the case as we had to fix a bug in the mutable extension, issue 8133 doc'ed at https://docs.sqlalchemy.org/en/14/changelog/changelog_14.html#change-f8b03063d70397a8f275287ed2c8f2e6 . this seemed to be enough of an edge case that I didn't attempt to reconcile the old broken format.
On Fri, Jun 24, 2022, at 9:16 AM, Evgenii wrote: > Hello! > We found bug in SA version `1.4.38` during deserialization. > How to reproduce: > > Serialize any ORM object with pickle using environment with any SA compatible > version `1.4.n` except `1.4.38` in , ex. `1.4.31`: > > ``` > pickle.dumps(obj) > ``` > > Deserialize result using environment with SA version == `1.4.38`: > > ``` > obj_loaded = pickle.loads(b'\x... > ``` > Got: > ``` > Traceback (most recent call last): > File "/home/user/anaconda3/envs/python375/lib/python3.7/code.py", line 90, in > runcode > exec(code, self.locals) > File "<input>", line 1, in <module> > File > "/home/user/anaconda3/envs/python375/lib/python3.7/site-packages/sqlalchemy/orm/state.py", > line 577, in __setstate__ > state_dict["manager"](self, inst, state_dict) > File > "/home/user/anaconda3/envs/python375/lib/python3.7/site-packages/sqlalchemy/orm/instrumentation.py", > line 506, in __call__ > manager.dispatch.unpickle(state, state_dict) > File > "/home/user/anaconda3/envs/python375/lib/python3.7/site-packages/sqlalchemy/event/attr.py", > line 343, in __call__ > fn(*args, **kw) > File > "/home/user/anaconda3/envs/python375/lib/python3.7/site-packages/sqlalchemy/ext/mutable.py", > line 505, in unpickle > for val in state_dict["ext.mutable.values"][key]: > TypeError: list indices must be integers or slices, not str > ``` > > Seems that backward compatibility is lost. > > > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > > http://www.sqlalchemy.org/ > > To post example code, please provide an MCVE: Minimal, Complete, and > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sqlalchemy+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy/f1ef4019-5ce4-4d14-938e-7a58f17db807n%40googlegroups.com > > <https://groups.google.com/d/msgid/sqlalchemy/f1ef4019-5ce4-4d14-938e-7a58f17db807n%40googlegroups.com?utm_medium=email&utm_source=footer>. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/be8f330d-d0ab-4b40-a753-df3f02a87cc7%40www.fastmail.com.