Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Newbie TypeError problem

Reply
Thread Tools

Newbie TypeError problem

 
 
Francis Moore
Guest
Posts: n/a
 
      04-01-2004
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.
 
Reply With Quote
 
 
 
 
Paul Prescod
Guest
Posts: n/a
 
      04-04-2004
Francis Moore wrote:

> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Metaclass conflict TypeError exception: problem demonstration script Barak, Ron Python 0 02-23-2009 09:32 AM
Newbie help (TypeError: int argument required) Iain Adams Python 2 06-09-2008 05:46 AM
datetime: .datetime-.datetime = .timedelta, .time-.time=TypeError ? Christos TZOTZIOY Georgiou Python 3 09-13-2003 10:44 AM
RE: datetime: .datetime-.datetime = .timedelta, .time-.time=TypeError ? Tim Peters Python 0 09-09-2003 12:57 AM
Newbie question: Strange TypeError Tim Isakson Python 2 07-07-2003 07:10 AM



Advertisments