classification
Title: multiprocessing Queue module failes to send INIConfig objects
Type: Stage:
Components: None Versions: Python 2.5
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: Zaar.Hai, georg.brandl
Priority: normal Keywords:

Created on 2010-05-04 14:17 by Zaar.Hai, last changed 2010-08-02 08:01 by Zaar.Hai. This issue is now closed.

Messages (3)
msg104942 - (view) Author: Zaar Hai (Zaar.Hai) Date: 2010-05-04 14:17
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).
msg112396 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-08-01 22:58
The issue in the iniparse tracker has been closed as "fixed" now, so I assume the problem was on that side.
msg112427 - (view) Author: Zaar Hai (Zaar.Hai) Date: 2010-08-02 08:01
Exactly.
Thank you.

On Mon, Aug 2, 2010 at 1:59 AM, Georg Brandl <report@bugs.python.org> wrote:
>
> Georg Brandl <georg@python.org> added the comment:
>
> The issue in the iniparse tracker has been closed as "fixed" now, so I assume the problem was on that side.
>
> ----------
> nosy: +georg.brandl
> resolution:  -> works for me
> status: open -> closed
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue8612>
> _______________________________________
>
History
Date User Action Args
2010-08-02 08:01:12Zaar.Haisetmessages: + msg112427
2010-08-01 22:58:58georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg112396

resolution: works for me
2010-05-04 14:17:14Zaar.Haicreate