[XML-SIG] Problems with elementtree and versions of python.

Tony McDonald tony.mcdonald at ncl.ac.uk
Tue Jul 29 10:52:47 EDT 2003


Hi all,
I've downloaded the elementtree module as it looks like a simpler way (for
me anyhow) of navigating through XML documents.

I'm having real problems with it though - and I think it's a python version
thing.

Eg using the code from
http://online.effbot.org/2003_07_01_archive.htm#element-tricks-2

OS-X 10.2.6, python 2.3b2 PyXML 0.8.2

% python
Python 2.3b2 (#3, Jul  3 2003, 22:26:01)
[GCC 3.1 20020420 (prerelease)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Welcome to Lazy Python.  Type "help LazyPython" for help.
>>> ^D
[506][tonymcd at saturn5 : Tue Jul 29 09:44]  ~/python
% python testrss.py
FEED 'online.effbot.org'
Traceback (most recent call last):
  File "testrss.py", line 50, in ?
    for item in feed:
TypeError: 'NoneType' object is not callable

Solaris 5.8, python 2.1.2, PyXML 0.6.5  (I believe that Uche, in his article
on elementtree used 2.1.2)

213[9:48]nnle at caduceus-temp ~/python > python
Python 2.1.3 (#3, May  3 2002, 16:46:21)
[GCC 2.95.3 20010315 (release)] on sunos5
Type "copyright", "credits" or "license" for more information.
Welcome to Lazy Python.  Type "help LazyPython" for help.
>>> 
214[9:48]nnle at localhost ~/python > python testrss
testrss.py   testrss.py~
214[9:48]nnle at localhost ~/python > python testrss.py
FEED 'online.effbot.org'
ITEM 'no observations' http://online.effbot.org#20030729
ITEM 'stupid element tricks, part 4 (PEA)'
http://online.effbot.org#element-tricks-4
ITEM 'observations' http://online.effbot.org#20030728
ITEM 'stupid element tricks, part 3 (RSS 0.9)'
http://online.effbot.org#element-tricks-3
ITEM 'the 2003 frank willison award for contributions to the python
community' http://online.effbot.org#frank-willison-award
ITEM 'stupid element tricks, part 2 (RSS 1.0)'
http://online.effbot.org#element-tricks-2
ITEM 'stupid element tricks' http://online.effbot.org#element-tricks
ITEM 'van rossum (and blokland) in new york times'
http://online.effbot.org#letterror
ITEM 'observations' http://online.effbot.org#20030724
ITEM 'observations' http://online.effbot.org#20030723

Solaris 5.8, python 2.2.3, PyXML 0.8.2
215[9:48]nnle at localhost ~/python > python2.2
Python 2.2.3 (#1, Jul 14 2003, 10:29:08)
[GCC 2.95.3 20010315 (release)] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> 
216[9:48]nnle at localhost ~/python > python2.2 testrss.py
FEED 'online.effbot.org'
Traceback (most recent call last):
  File "testrss.py", line 50, in ?
    for item in feed:
TypeError: 'NoneType' object is not callable


I had thought initially that it may be a PyXML problem, but it seems it's
deeper than that, and frankly, I have no idea how to take this any
further...

Any thoughts?

Cheers,
Tone.
-- 
Dr Tony McDonald,  Assistant Director, FMSC, http://www.fmcc.org.uk/
The Medical School, Newcastle University Tel: +44 191 245 4223
Project Manager, FDTL-4 Electronic Portfolios http://www.eportfolios.ac.uk
A Zope list for UK HE/FE  http://www.fmcc.org.uk/mailman/listinfo/zope




More information about the XML-SIG mailing list