From 08a92cb56874537b88a224e9fcd6a3d89a5a703b Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Sun, 10 Oct 1999 21:14:25 +0000 Subject: [PATCH] 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). --- Lib/pickle.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/pickle.py b/Lib/pickle.py index 7164eb1e395..5cc92bf9d0d 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: