This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kxroberto
Recipients kxroberto
Date 2011-11-25.09:02:41
SpamBayes Score 0.000306088
Marked as misclassified No
Message-id <>
When a class definition was re-executed (reload, exec ..) , pickling of existing instances fails for to picky reason (class object id mismatch). Solved by the one liner patch below.

Rational: Python is dynamic. Like with any normal attribute lookup: When its the same module/  this class is really meant - no matter about its id. 
(During unpickling its another id anyway, the code may have evolved years ...)

diff -ur --strip _orig/ ./
--- _orig/	2008-09-08 10:58:32 +0000
+++ ./	2011-11-24 15:47:11 +0000
@@ -747,7 +747,7 @@
                 "Can't pickle %r: it's not found as %s.%s" %
                 (obj, module, name))
-            if klass is not obj:
+            if klass.__name__ != obj.__name__:
                 raise PicklingError(
                     "Can't pickle %r: it's not the same object as %s.%s" %
                     (obj, module, name))
Date User Action Args
2011-11-25 09:02:43kxrobertosetrecipients: + kxroberto
2011-11-25 09:02:43kxrobertosetmessageid: <>
2011-11-25 09:02:42kxrobertolinkissue13479 messages
2011-11-25 09:02:41kxrobertocreate