Opened 4 years ago

Last modified 4 years ago

#14737 new defect

wxNotebook when accessing not initialized page

Reported by: wujek.brulion Owned by:
Priority: low Milestone:
Component: wxPython Version: 2.9.3
Keywords: Cc:
Blocked By: Blocking:
Patch: no


I'm using wxPython on winXP. This code crashes:

import wx

class MainFrame(wx.Frame):

  def __init__(self):
    wx.Frame.__init__(self, None, title="Simple Notebook Example")
    p = wx.Panel(self) 
    nb = wx.Notebook(p) 
    page = nb.GetPage(0) 
    print "end"

if __name__ == "__main__":

  app = wx.App() 

This line seems crucial:
page = nb.GetPage(0)

Change History (2)

comment:1 Changed 4 years ago by vadz

  • Priority changed from normal to low
  • Status changed from new to infoneeded_new

Are you sure it really crashes and not just asserts?

Accessing the non-existent page is, of course, an error, but it shouldn't result in a crash, just assert failure, as usual.

comment:2 Changed 4 years ago by wujek.brulion

  • Status changed from infoneeded_new to new

If there's any page added to Notebook and I'm accessing not existing page, I get wx._core.PyAssertionError.

If there's no page added, python process crashes.

Note: See TracTickets for help on using tickets.