[issue31467] cElementTree behaves differently compared to ElementTree
New submission from Ravikumar:
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
1
2008
141100
/tmp/Python$
OUTPUT
/tmp/Python$ python testxml.py
Traceback (most recent call last):
File "testxml.py", line 10, in
elems_saved["1"]=root
File "", 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
--
components: Library (Lib), XML
messages: 302164
nosy: poojariravi
priority: normal
severity: normal
status: open
title: cElementTree behaves differently compared to ElementTree
type: behavior
versions: Python 2.7
___
Python tracker
<https://bugs.python.org/issue31467>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31467] cElementTree behaves differently compared to ElementTree
Ravikumar added the comment: Thanks for the quick update. It helped us to understand the issue. We will check of how to proceed further in our implementation. / Ravi -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue31467> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31467] cElementTree behaves differently compared to ElementTree
Ravikumar added the comment: Just now I have figured out that , in the documentation it was mentioned that cElementTree module is deprecated in Python 3.3 version. "The xml.etree.ElementTree module implements a simple and efficient API for parsing and creating XML data. Changed in version 3.3: This module will use a fast implementation whenever available. The xml.etree.cElementTree module is deprecated." https://docs.python.org/3/library/xml.etree.elementtree.html In that case, will your resolution comment still holds valid ?? If so then, how to use cElementTree in my usecase -- status: closed -> open ___ Python tracker <https://bugs.python.org/issue31467> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31467] cElementTree behaves differently compared to ElementTree
Changes by Ravikumar : -- status: open -> closed ___ Python tracker <https://bugs.python.org/issue31467> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
