2014-02-04, 15:18
I have a bizarre problem.
Well, at least for me. Here is the import:
Since cElement.Tree is available it is imported as XML parser. However when I fetch XML from a server and I try to parse it I get an error. If I switch to plain Element.Tree, this error does not occur :
I would like to avoid snitching to plain Element.Tree if at all possible since it is approx 3-5 times slower with larger XMLs resulting in 5-7 sec wait times on Mac Mini (minutes on RPi).
This is on OS X, both 12.3 and nightly Gotham. I'm not sure if it happens on 12.2 - will try to check later.
I'm lame python coder for sure but above seems like a valid XML to me so I guess real problem is somewhere else?
Well, at least for me. Here is the import:
Code:
try:
import xml.etree.cElementTree as etree
except ImportError:
try:
import cElementTree as etree
except ImportError:
try:
import xml.etree.ElementTree as etree
Since cElement.Tree is available it is imported as XML parser. However when I fetch XML from a server and I try to parse it I get an error. If I switch to plain Element.Tree, this error does not occur :
Code:
13:46:48 T:4533088256 NOTICE: PleXBMC -> getURL: ====== XML returned =======
13:46:48 T:4533088256 NOTICE: <?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="2" allowSync="0" identifier="com.plexapp.plugins.library" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1368787250" title1="Plex Library">
<Directory allowSync="1" art="/:/resources/movie-fanart.jpg" filters="1" refreshing="0" thumb="/:/resources/movie.png" key="7" type="movie" title="Movies" agent="com.plexapp.agents.imdb" scanner="Plex Movie Scanner" language="en" uuid="a055eb57-fd24-499d-a520-a1c160848d58" updatedAt="1391085646" createdAt="1391085629">
<Location id="8" path="/Volumes/WD/Movies" />
</Directory>
<Directory allowSync="1" art="/:/resources/show-fanart.jpg" filters="1" refreshing="0" thumb="/:/resources/show.png" key="8" type="show" title="TV Shows" agent="com.plexapp.agents.thetvdb" scanner="Plex Series Scanner" language="en" uuid="626447e7-24f7-476a-983e-c1c2009a7efb" updatedAt="1391086633" createdAt="1391085723">
<Location id="9" path="/Volumes/WD/TV Shows" />
</Directory>
</MediaContainer>
13:46:48 T:4533088256 NOTICE: PleXBMC -> getURL: ====== XML finished ======
13:46:48 T:4533088256 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.TypeError'>
Error Contents: 'NoneType' object is not callable
Traceback (most recent call last):
File "/Users/pecinko/Library/Application Support/XBMC/addons/plugin.video.plexbmc/default.py", line 5225, in <module>
amberskin()
File "/Users/pecinko/Library/Application Support/XBMC/addons/plugin.video.plexbmc/default.py", line 3773, in amberskin
sections = getAllSections()
File "/Users/pecinko/Library/Application Support/XBMC/addons/plugin.video.plexbmc/default.py", line 627, in getAllSections
tree = etree.fromstring(section_xml)
File "<string>", line 84, in XML
TypeError: 'NoneType' object is not callable
-->End of Python script error report<--
I would like to avoid snitching to plain Element.Tree if at all possible since it is approx 3-5 times slower with larger XMLs resulting in 5-7 sec wait times on Mac Mini (minutes on RPi).
This is on OS X, both 12.3 and nightly Gotham. I'm not sure if it happens on 12.2 - will try to check later.
I'm lame python coder for sure but above seems like a valid XML to me so I guess real problem is somewhere else?