Newbie TypeError problem

F

Francis Moore

Hi,

Getting the following traceback from parsing an xml file:

Traceback (most recent call last):
File "D:\Python23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
line 310, in RunScript
exec codeObject in __main__.__dict__
File "D:\Development\OmniForm Converter\OFML to SHF\ListFile.py",
line 74, in ?
try:
File "D:\Python23\lib\xml\sax\expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "D:\Python23\lib\xml\sax\xmlreader.py", line 119, in parse
self.prepareParser(source)
File "D:\Python23\lib\xml\sax\expatreader.py", line 111, in
prepareParser
self._parser.SetBase(source.getSystemId())
TypeError: SetBase() argument 1 must be string, not member_descriptor

Seems to be failing on the line:

parser.parse(file)

But I can't see what the problem is. The program worked successfully
and I don't remember changing anything major, so I can't understand
what it's complaining about. Looking at expatreader.py hasn't really
helped as my Python knowledge isn't that great yet.

Any help much appreciated.

Thanks,
Francis.
 
P

Paul Prescod

Francis said:
File "D:\Python23\lib\xml\sax\expatreader.py", line 111, in
prepareParser
self._parser.SetBase(source.getSystemId())
TypeError: SetBase() argument 1 must be string, not member_descriptor

Seems to be failing on the line:

parser.parse(file)

Please insert this line into your program:

print type(file)

Perhaps the type is something other than you expect?

Paul Prescod
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top