Message302164
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 |
|
Date |
User |
Action |
Args |
2017-09-14 10:06:21 | poojariravi | set | recipients:
+ poojariravi |
2017-09-14 10:06:21 | poojariravi | set | messageid: <1505383581.51.0.650948952182.issue31467@psf.upfronthosting.co.za> |
2017-09-14 10:06:21 | poojariravi | link | issue31467 messages |
2017-09-14 10:06:21 | poojariravi | create | |
|