Author: phd
Date: Sun May 26 09:08:50 2013
New Revision: 4602
Log:
Fixed cache handling on unpickling
Modified:
SQLObject/branches/1.3/docs/Authors.txt
SQLObject/branches/1.3/docs/News.txt
SQLObject/branches/1.3/sqlobject/main.py
SQLObject/branches/1.3/sqlobject/tests/test_pickle.py
Modified: SQLObject/branches/1.3/docs/Authors.txt
==============================================================================
--- SQLObject/branches/1.3/docs/Authors.txt Sun May 26 09:05:11 2013 (r4601)
+++ SQLObject/branches/1.3/docs/Authors.txt Sun May 26 09:08:50 2013 (r4602)
@@ -26,6 +26,7 @@
* Daniel Fetchinson <fetchinson at googlemail.com>
* Neil Muller <drnlmuller+sqlobject at gmail.com>
* Petr Jakes <petr.jakes at tpc.cz>
+* Andrew Trusty <atrusty at gatech.edu>
* Oleg Broytman <ph...@ph...>
.. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10
Modified: SQLObject/branches/1.3/docs/News.txt
==============================================================================
--- SQLObject/branches/1.3/docs/News.txt Sun May 26 09:05:11 2013 (r4601)
+++ SQLObject/branches/1.3/docs/News.txt Sun May 26 09:08:50 2013 (r4602)
@@ -7,6 +7,14 @@
.. _start:
+SQLObject 1.3.3
+===============
+
+Released 26 May 2013.
+
+* Fixed bugs in pickling and unpickling (remove/restore a weak proxy to self,
+ fixed cache handling).
+
SQLObject 1.3.2
===============
Modified: SQLObject/branches/1.3/sqlobject/main.py
==============================================================================
--- SQLObject/branches/1.3/sqlobject/main.py Sun May 26 09:05:11 2013 (r4601)
+++ SQLObject/branches/1.3/sqlobject/main.py Sun May 26 09:08:50 2013 (r4602)
@@ -1696,7 +1696,7 @@
if cache.tryGet(self.id, cls) is not None:
raise ValueError(
"Cannot unpickle %s row with id=%s - a different instance with the id already exists in the cache" % (cls.__name__, self.id))
- cache.created(id, cls, self)
+ cache.created(self.id, cls, self)
def setterName(name):
Modified: SQLObject/branches/1.3/sqlobject/tests/test_pickle.py
==============================================================================
--- SQLObject/branches/1.3/sqlobject/tests/test_pickle.py Sun May 26 09:05:11 2013 (r4601)
+++ SQLObject/branches/1.3/sqlobject/tests/test_pickle.py Sun May 26 09:08:50 2013 (r4602)
@@ -21,7 +21,9 @@
pickle_data = pickle.dumps(test, pickle.HIGHEST_PROTOCOL)
connection.cache.clear()
test = pickle.loads(pickle_data)
+ test2 = connection.cache.tryGet(test.id, TestPickle)
+ assert test2 is test
assert test.question == test_question
assert test.answer == test_answer
|