]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Jeremy writes:
authorGuido van Rossum <guido@python.org>
Sun, 10 Oct 1999 21:14:25 +0000 (21:14 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 10 Oct 1999 21:14:25 +0000 (21:14 +0000)
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

index 7164eb1e395462b3e9046ad9e2719fe9abf95bc6..5cc92bf9d0d06a1d0e2a96298425cee12ae58fe0 100644 (file)
@@ -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: