Can't pickle metadata with BOOLEAN columns in 0.6beta1

Issue #1694 resolved
Former user created an issue

The following code:

from sqlalchemy import *

meta = MetaData()
Table('foo',meta,Column('bar',BOOLEAN()))

from cPickle import dumps
dumps(meta)

throws

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/vol/devel/env/lib/python2.6/copy_reg.py", line 70, in _reduce_ex
    raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle function objects

Replacing cPickle with pickle:

...
  File "/usr/lib/python2.6/pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "/usr/lib/python2.6/pickle.py", line 748, in save_global
    (obj, module, name))
pickle.PicklingError: Can't pickle <function should_create_constraint at 0x7f77e5541c80>: it's not found as sqlalchemy.types.should_create_constraint

Comments (7)

  1. Log in to comment