From: Guido van Rossum Date: Sun, 10 Oct 1999 21:14:25 +0000 (+0000) Subject: Jeremy writes: X-Git-Tag: v1.6a1~829 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=08a92cb56874537b88a224e9fcd6a3d89a5a703b;p=thirdparty%2FPython%2Fcpython.git Jeremy writes: I found the following patch helpful in tracking down a bug in some code. I had appended time, the module, instead of time.time(). Not sure if it is generally true that printing the repr of the object is good, but I expect that most unpicklable things will have fairly information and concise reprs (like files or sockets or modules). --- diff --git a/Lib/pickle.py b/Lib/pickle.py index 7164eb1e3954..5cc92bf9d0d0 100644 --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -157,7 +157,8 @@ class Pickler: reduce = object.__reduce__ except AttributeError: raise PicklingError, \ - "can't pickle %s objects" % `t.__name__` + "can't pickle %s object: %s" % (`t.__name__`, + `object`) else: tup = reduce() else: