This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author poojariravi
Recipients poojariravi
Date 2017-09-14.10:06:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1505383581.51.0.650948952182.issue31467@psf.upfronthosting.co.za>
In-reply-to
Content
I have started learning python and I see below snippet fails. I do not understand how to fix the issue and assume this might be a bug in multiprocessing library.

I use Python 2.7.12


My python snippet

import xml.etree.ElementTree as ET    # WORKS
import xml.etree.cElementTree as ET    # DOES NOT WORK
import multiprocessing

tree = ET.parse('country_data.xml')
root = tree.getroot()

manager = multiprocessing.Manager()
elems_saved = manager.dict()

elems_saved["1"]=root


/tmp/Python$ cat country_data.xml 
<?xml version="1.0"?>
<data>
    <country name="Liechtenstein">
        <rank>1</rank>
        <year>2008</year>
        <gdppc>141100</gdppc>
        <neighbor name="Austria" direction="E"/>
        <neighbor name="Switzerland" direction="W"/>
    </country>
</data>
/tmp/Python$


OUTPUT

/tmp/Python$ python testxml.py 
Traceback (most recent call last):
  File "testxml.py", line 10, in <module>
    elems_saved["1"]=root
  File "<string>", line 2, in __setitem__
  File "/usr/lib/python2.7/multiprocessing/managers.py", line 758, in _callmethod
    conn.send((self._id, methodname, args, kwds))
TypeError: expected string or Unicode object, NoneType found

Please let me know if I am wrong
History
Date User Action Args
2017-09-14 10:06:21poojariravisetrecipients: + poojariravi
2017-09-14 10:06:21poojariravisetmessageid: <1505383581.51.0.650948952182.issue31467@psf.upfronthosting.co.za>
2017-09-14 10:06:21poojariravilinkissue31467 messages
2017-09-14 10:06:21poojariravicreate