[Pythonmac-SIG] Updating to PyXML
Josh English
english@spiritone.com
8 Oct 2002 08:28:43 -0700
This is another strange problem I'm running into on an older project. I
do math tutoring and I keep the log of my tutoring sessions in an xml
file, I wrote a couple of parsers based off of xml.dom minidom to create
customized Class Objects that I've defined in Python, and I coded a
small window using W widgets so I can scroll through everything with no
difficulty, I can add new items to my database and it spits out a new
XML file.
So far everything was running smoothly until I decided to explore the
PyXML package. I downloaded it and (while Python wasn't running) renamed
the xml folder in my Python/Lib folder to 'oldxml'. I then moved the xml
folder from the PyXML distribution into my Python/Lib folder, started
Python and tried to work with my Tutor Log. This is what I got:
>>> import TutorLogParser
>>> d = TutorLogParser.DefaultLogParser()
Traceback (most recent call last):
File "<input>", line 1, in ?
File "Marvin:Applications (Mac OS 9):Python
2.2:Scripts:TutorLogParser.py", line 6, in __init__
self.LoadSource(_logpath)
File "Marvin:Applications (Mac OS 9):Python
2.2:Scripts:TutorLogParser.py", line 11, in LoadSource
self.Source = minidom.parse(source).documentElement
File "Marvin:Applications (Mac OS 9):Python
2.2:Lib:xml:dom:minidom.py", line 1595, in parse
return expatbuilder.parse(file)
File "Marvin:Applications (Mac OS 9):Python
2.2:Lib:xml:dom:expatbuilder.py", line 928, in parse
result = builder.parseFile(fp)
File "Marvin:Applications (Mac OS 9):Python
2.2:Lib:xml:dom:expatbuilder.py", line 166, in parseFile
parser = self.getParser()
File "Marvin:Applications (Mac OS 9):Python
2.2:Lib:xml:dom:expatbuilder.py", line 119, in getParser
self._parser = self.createParser()
File "Marvin:Applications (Mac OS 9):Python
2.2:Lib:xml:dom:expatbuilder.py", line 734, in createParser
parser.namespace_prefixes = True
AttributeError: namespace_prefixes
Some of these error messages and line numbers don't seem to correspond
with the actual files themselves, and the debugger tells me that it
can't find the expatbuilder.py file.
I quit Python, took out the xml folder, renamed 'oldxml' back to 'xml',
thinking that this would restore things to the way they were, and I get
the same error messages.
Any clues as to what is happening here? The PyXML documents state that
the minidom package is the same as the Python distribution, so I can't
see why this change occured.
Josh English
english@spiritone.com