|
From: Michael F. <fuz...@vo...> - 2006-07-17 09:59:48
|
Jack Kuan wrote:
> Hi all,
>
> when trying to use a ConfigObj with the shelve module, I get the
> following exception while trying to
> print the unpickled ConfigObj in the shelf:
>
> $ python ./test.py
> Traceback (most recent call last):
> File "./test.py", line 15, in ?
> print shelf['b0conf']
> File "/home/versant/Apps/lib/python/configobj.py", line 537, in __repr__
> return '{%s}' % ', '.join([('%s: %s' % (repr(key), repr(self[key])))
> File "/home/versant/Apps/lib/python/configobj.py", line 537, in __repr__
> return '{%s}' % ', '.join([('%s: %s' % (repr(key), repr(self[key])))
> File "/home/versant/Apps/lib/python/configobj.py", line 376, in
> __getitem__
> if self.main.interpolation and isinstance(val, StringTypes):
> AttributeError: 'dict' object has no attribute 'interpolation'
>
> How can I correctly pickle/unpickle a ConfigObj object?
>
It looks like it will take a bit of work to make ConfigObj 'pickle-able'.
I will try and support this in ConfigObj 4.4.
Thanks
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
> Thanks,
> Jack
>
>
|