PicklingError on DateTime objects

swdev swdevpatrick at my-deja.com
Mon Jun 26 23:32:44 EDT 2000


Hey All,

just taking a wild shot here, but... someone may have seen this.

I'm trying to write a pickle containing an object instance.  Within this
object instance is an attr containing a DateTime object instance.

When I call pickle.dump(obj, somefile), i get different outcomes
depending on platform; on Linux it works famously, no pause, just works.
On Solaris, it throws the following exception:

>>> pickle.dump(u, of)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python1.5/pickle.py", line 818, in dump
    Pickler(file, bin).dump(object)
  File "/usr/local/lib/python1.5/pickle.py", line 97, in dump
    self.save(object)
  File "/usr/local/lib/python1.5/pickle.py", line 198, in save
    f(self, object)
  File "/usr/local/lib/python1.5/pickle.py", line 412, in save_inst
    save(stuff)
  File "/usr/local/lib/python1.5/pickle.py", line 198, in save
    f(self, object)
  File "/usr/local/lib/python1.5/pickle.py", line 361, in save_dict
    save(value)
  File "/usr/local/lib/python1.5/pickle.py", line 159, in save
    raise PicklingError, \
pickle.PicklingError: can't pickle 'DateTime' objects

Any ideas?  Thanks for any help at all!
--p


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list