[Python-Dev] XML module causes profiler to throw

Andrew P. Lentvorski bsder@mail.allcaps.org
Mon, 1 Jul 2002 17:20:07 -0700 (PDT)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--0-1139718406-1025569154=:290
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID: <20020701171925.N290@mail.allcaps.org>

Okay, I created a tiny, self-sufficient file which demonstrates the
problem without requiring external files or anything else silly like that.
I tried to attach it to SourceForge bug 534864, but I'm apparently too
dumb to figure out how to do it.

-a

Here's the log, the source file is attached:

Python 2.2.1 (#1, May 27 2002, 16:42:22)
[GCC 2.95.3 20010315 (release) [FreeBSD]] on freebsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> import profile
>>> import xmltest
>>> profile.run('xmltest.main()')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.2/profile.py", line 71, in run
    prof = prof.run(statement)
  File "/usr/local/lib/python2.2/profile.py", line 404, in run
    return self.runctx(cmd, dict, dict)
  File "/usr/local/lib/python2.2/profile.py", line 410, in runctx
    exec cmd in globals, locals
  File "<string>", line 1, in ?
  File "xmltest.py", line 24, in main
    xml.sax.parseString(testxml, chand)
  File "/usr/local/lib/python2.2/xml/sax/__init__.py", line 49, in parseString
    parser.parse(inpsrc)
  File "/usr/local/lib/python2.2/xml/sax/expatreader.py", line 90, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/local/lib/python2.2/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/local/lib/python2.2/xml/sax/expatreader.py", line 143, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/local/lib/python2.2/xml/sax/expatreader.py", line 216, in start_element
    def start_element(self, name, attrs):
  File "/usr/local/lib/python2.2/profile.py", line 214, in trace_dispatch_i
    if self.dispatch[event](self, frame,t):
  File "/usr/local/lib/python2.2/profile.py", line 260, in trace_dispatch_call
    assert rframe.f_back is frame.f_back, ("Bad call", rfn,
AssertionError: ('Bad call', ('/usr/local/lib/python2.2/xml/sax/expatreader.py', 132, 'feed'), <frame object at 0x81a880c>, <frame object at 0x81a840c>, <frame object at 0x81bb60c>, <frame object at 0x81a8a0c>)
>>> xmltest.main()
start element
end element



--0-1139718406-1025569154=:290
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="xmltest.py"
Content-Transfer-Encoding: BASE64
Content-ID: <20020701171914.A290@mail.allcaps.org>
Content-Description: 
Content-Disposition: ATTACHMENT; FILENAME="xmltest.py"

IyEvdXNyL2Jpbi9lbnYgcHl0aG9uDQoNCmltcG9ydCB4bWwuc2F4DQoNCnRl
c3R4bWwgPSBcDQoiIiINCjxodG1sIC8+DQoiIiINCg0KY2xhc3MgQ29udGVu
dEhhbmRsZXIoeG1sLnNheC5Db250ZW50SGFuZGxlcik6DQogICAgIiIiIEhh
bmRsZSBjYWxsYmFja3MgZnJvbSB0aGUgU0FYIFhNTCBwYXJzZXIuICIiIg0K
DQogICAgZGVmIF9faW5pdF9fKHNlbGYpOg0KICAgICAgICBwYXNzDQoNCiAg
ICBkZWYgc3RhcnRFbGVtZW50KHNlbGYsIG5hbWUsIGF0dHJzKToNCiAgICAg
ICAgcHJpbnQgInN0YXJ0IGVsZW1lbnQiDQoNCiAgICBkZWYgZW5kRWxlbWVu
dChzZWxmLCBuYW1lKToNCiAgICAgICAgcHJpbnQgImVuZCBlbGVtZW50Ig0K
DQpkZWYgbWFpbigpOg0KICAgIGNoYW5kID0gQ29udGVudEhhbmRsZXIoKQ0K
ICAgIHhtbC5zYXgucGFyc2VTdHJpbmcodGVzdHhtbCwgY2hhbmQpDQoNCmlm
IF9fbmFtZV9fID09ICJfX21haW5fXyI6DQogICAgbWFpbigpDQo=
--0-1139718406-1025569154=:290--