Issue 20 in iniparse: config object are not passable to Queue object from multiprocessing module.

17 views
Skip to first unread message

inip...@googlecode.com

unread,
May 4, 2010, 9:28:55 AM5/4/10
to iniparse...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 20 by HaiZaar: config object are not passable to Queue object
from multiprocessing module.
http://code.google.com/p/iniparse/issues/detail?id=20

Python multiprocessing module have very nice Queue class to pass messages
(objects) between the processed. I've tried to use this to propagate
configuration changes between the processes. However, INIConfig instances
have trouble with this.

What steps will reproduce the problem?
1. Place attached my.conf and mysend.py in the same directory.
2. Run python ./mysend.py
3.

What is the expected output? What do you see instead?
I would expect "test1" to be printed. Instead, I see this error messages:
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

What version of the product are you using? On what operating system?
I'm using python 2.5.2 on Debian Lenny amd 64 bit. iniparse 0.3.2.

Please provide any additional information below.



Attachments:
my.conf 69 bytes
mysend.py 391 bytes

--
To post to this group, send email to iniparse...@googlegroups.com
To unsubscribe from this group, send email to iniparse-commi...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/iniparse-commits?hl=en

inip...@googlecode.com

unread,
May 4, 2010, 9:38:19 AM5/4/10
to iniparse...@googlegroups.com

Comment #1 on issue 20 by HaiZaar: config object are not passable to Queue
object from multiprocessing module.
http://code.google.com/p/iniparse/issues/detail?id=20

If you've never heard of multiprocessing module, here is the quick link:
http://docs.python.org/library/multiprocessing.html

inip...@googlecode.com

unread,
May 4, 2010, 11:49:21 PM5/4/10
to iniparse...@googlegroups.com
Updates:
Status: Accepted

Comment #2 on issue 20 by psoberoi: config object are not passable to Queue
object from multiprocessing module.
http://code.google.com/p/iniparse/issues/detail?id=20

I think the underlying problem is with pickling. It's easy to reproduce:

>>> c=iniparse.INIConfig()
>>> c.x.y = 1
>>> pickle.dumps(c, -1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/pickle.py", line 1366, in dumps
Pickler(file, protocol).dump(obj)
File "/usr/lib/python2.6/pickle.py", line 224, in dump
self.save(obj)
File "/usr/lib/python2.6/pickle.py", line 306, in save
rv = reduce(self.proto)
TypeError: 'Undefined' object is not callable


inip...@googlecode.com

unread,
May 5, 2010, 1:36:30 AM5/5/10
to iniparse...@googlegroups.com
Updates:
Status: Fixed

Comment #3 on issue 20 by psoberoi: config object are not passable to Queue
object from multiprocessing module.
http://code.google.com/p/iniparse/issues/detail?id=20

This issue was closed by revision r134.

inip...@googlecode.com

unread,
May 5, 2010, 3:18:21 AM5/5/10
to iniparse...@googlegroups.com

Comment #4 on issue 20 by HaiZaar: config object are not passable to Queue
object from multiprocessing module.
http://code.google.com/p/iniparse/issues/detail?id=20

Thanks for quick response!
Although your pickle example works fine after applying the patch, mysend.py
still
reports the same error.

inip...@googlecode.com

unread,
May 5, 2010, 1:18:42 PM5/5/10
to iniparse...@googlegroups.com
Updates:
Status: Accepted

Comment #5 on issue 20 by psoberoi: config object are not passable to Queue
object from multiprocessing module.
http://code.google.com/p/iniparse/issues/detail?id=20

I should have tried the original code before declaring victory. I can
reproduce the
error, but I get a slightly different traceback than the original:

Traceback (most recent call last):
File "/usr/lib/python2.6/multiprocessing/queues.py", line 242, in _feed
send(obj)
TypeError: 'NoneType' object is not callable

inip...@googlecode.com

unread,
May 6, 2010, 1:42:22 AM5/6/10
to iniparse...@googlegroups.com

Comment #6 on issue 20 by HaiZaar: config object are not passable to Queue
object from multiprocessing module.
http://code.google.com/p/iniparse/issues/detail?id=20

I think the difference is because of you have python2.6 and I python2.5. Do
you have
any clues on how to deal with it?

inip...@googlecode.com

unread,
May 7, 2010, 1:55:27 AM5/7/10
to iniparse...@googlegroups.com
Updates:
Status: Fixed

Comment #7 on issue 20 by psoberoi: config object are not passable to Queue
object from multiprocessing module.
http://code.google.com/p/iniparse/issues/detail?id=20

This issue was closed by revision r137.

inip...@googlecode.com

unread,
May 12, 2010, 11:43:45 AM5/12/10
to iniparse...@googlegroups.com

Comment #8 on issue 20 by HaiZaar: config object are not passable to Queue
object from multiprocessing module.
http://code.google.com/p/iniparse/issues/detail?id=20

The victory has been accomplished!!! Many thanks!!
Reply all
Reply to author
Forward
0 new messages