minidom + wxPython woes

Lonnie Princehouse finite.automaton at gmail.com
Fri Apr 7 18:20:49 EDT 2006


Hi all,

I'm getting a seg fault when I try to use minidom to parse some XML
inside a wxPython app.

I was wondering if someone else could run the simple code below on
Linux and, if it doesn't crash horribly, post which versions of
(Python, wxPython) they are using?  I can't find other messages related
to this, so I suspect it is something broken with my installation.
I'm using Python 2.4.2 and wx 2.6.1.0.

Incidentally, writing XML with minidom works fine, and this is all
happening in wxPython's main thread.


import wx
from xml.dom import minidom

app = wx.PySimpleApp()
frame = wx.Frame(None, -1, "Hello World")
frame.Show(True)
button = wx.Button(frame, -1, "Click me")

testxml = 'xml version="1.0" ?><foo></foo>'

def click(event):
    doc = minidom.parseString(testxml) # seg fault?!
    print "Success!"

frame.Bind(wx.EVT_BUTTON, click, button)

app.MainLoop()




More information about the Python-list mailing list