I'm using INIConfig class from iniparse module(http://code.google.com/p/iniparse).
I've tried to use multiprocessing.Queue to propagate
configuration changes between the processes. However, INIConfig instances
have troubles being pushed through Queue objects.
I do not know whether this is a Queue or iniparse bug, so I've opened issued on both projects(http://code.google.com/p/iniparse/issues/detail?id=20). Even this is not a Queue bug, it would be great to have some advice on how this problem may be solved. Thanks.
Problem description:
Running this simple code:
from multiprocessing import Process
from multiprocessing import Queue
from iniparse import INIConfig
import time
def worker(queue):
config = queue.get()
print config.sec1.var1
def main():
config = INIConfig(open("./my.conf"))
queue = Queue()
p = Process(target=worker, args=(queue,))
p.start()
queue.put(config)
time.sleep(1)
if __name__ == "__main__":
main()
Raised this error:
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.5/multiprocessing/queues.py", line 242, in _feed
send(obj)
TypeError: 'Undefined' object is not callable
The contents of my.conf are like this:
[sec1]
var1 = test1
var2 = test2
I'm using python 2.5.2 on Debian Lenny amd64 with python-multiprocessing package (http://packages.debian.org/squeeze/python-multiprocessing).
|