Newbie TypeError problem

Discussion in 'Python' started by Francis Moore, Apr 1, 2004.

  1. 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.
     
    Francis Moore, Apr 1, 2004
    #1
    1. Advertising

  2. Francis Moore

    Paul Prescod Guest

    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
     
    Paul Prescod, Apr 4, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tim Isakson

    Newbie question: Strange TypeError

    Tim Isakson, Jul 7, 2003, in forum: Python
    Replies:
    2
    Views:
    301
    Adrien Di Mascio
    Jul 7, 2003
  2. Christos TZOTZIOY Georgiou
    Replies:
    3
    Views:
    710
    Christos TZOTZIOY Georgiou
    Sep 13, 2003
  3. Tim Peters
    Replies:
    0
    Views:
    536
    Tim Peters
    Sep 9, 2003
  4. Iain Adams
    Replies:
    2
    Views:
    372
    bukzor
    Jun 9, 2008
  5. Barak, Ron
    Replies:
    0
    Views:
    298
    Barak, Ron
    Feb 23, 2009
Loading...

Share This Page