I get the following error when using multiprocessing:
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
self.run()
File "/usr/lib/python2.6/threading.py", line 477, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/lib/python2.6/multiprocessing/pool.py", line 282, in _handle_results
task = get()
UnpicklingError: NEWOBJ class argument has NULL tp_new
I have absolutely no idea what this means, although it sounds like something's wrong at the C level. Can anyone shed some light on this?
UPDATE: Ok, so I figured out how to fix this. But I'm still a bit perplexed. I'm returning an instance of this class:
class SpecData(object):
def __init__(self, **kwargs):
self.__dict__.update(**kwargs)
def to_dict(self):
return self.__dict__
If I return an instance of this object, I get the error. However, if I call to_dict
and return a dictionary, it works. What am I doing wrong?