Phoenix: wx.Notebook.SetSelection, always fails assert

I’m using wxPython Phoenix 3.0.2.dev77067.
Calling SetSelection or ChangeSelection on a wx.Notebook appears to always fail an assert claiming the page number is out of range. Attached is a small example illustrating this.

wx._core.wxAssertionError: C++ assertion “((nPage) < GetPageCount())” failed at …\src\msw\notebook.cpp(406) in wxNotebook::ChangeSelection(): notebook page out of range

Is this a known problem with a workaround? If not I can enter a bug for it. I have not seen it mentioned in the changelogs since this dev build was created.

Thanks!

  • Adam

notebook_test.py (1.41 KB)

I just tested it on Classic (2.9.4 and 3.0.1 MSW) and it works, if you didn’t know that already.

···

On Thursday, September 11, 2014 8:36:20 AM UTC-7, Adam Pletcher wrote:

I’m using wxPython Phoenix 3.0.2.dev77067.
Calling SetSelection or ChangeSelection on a wx.Notebook appears to always fail an assert claiming the page number is out of range. Attached is a small example illustrating this.

wx._core.wxAssertionError: C++ assertion “((nPage) < GetPageCount())” failed at …..\src\msw\notebook.cpp(406) in wxNotebook::ChangeSelection(): notebook page out of range

Is this a known problem with a workaround? If not I can enter a bug for it. I have not seen it mentioned in the changelogs since this dev build was created.

Thanks!

Yeah, we noticed this while attempting to port a tool that works fine in classic 3.0.0.0 MSW.
Thanks, though.

  • Adam
···

On Thursday, September 11, 2014 12:03:31 PM UTC-5, Nathan McCorkle wrote:

On Thursday, September 11, 2014 8:36:20 AM UTC-7, Adam Pletcher wrote:

I’m using wxPython Phoenix 3.0.2.dev77067.
Calling SetSelection or ChangeSelection on a wx.Notebook appears to always fail an assert claiming the page number is out of range. Attached is a small example illustrating this.

wx._core.wxAssertionError: C++ assertion “((nPage) < GetPageCount())” failed at …..\src\msw\notebook.cpp(406) in wxNotebook::ChangeSelection(): notebook page out of range

Is this a known problem with a workaround? If not I can enter a bug for it. I have not seen it mentioned in the changelogs since this dev build was created.

Thanks!

I just tested it on Classic (2.9.4 and 3.0.1 MSW) and it works, if you didn’t know that already.

Hi Adam,

···

On 9/11/2014 17:36, Adam Pletcher wrote:

I'm using wxPython Phoenix 3.0.2.dev77067.
Calling SetSelection or ChangeSelection on a wx.Notebook appears to always fail an assert claiming the page number is out of range. Attached is a small example illustrating this.

wx._core.wxAssertionError: C++ assertion "((nPage) < GetPageCount())" failed at ..\..\src\msw\notebook.cpp(406) in wxNotebook::ChangeSelection(): notebook page out of range

Is this a known problem with a workaround? If not I can enter a bug for it. I have not seen it mentioned in the changelogs since this dev build was created.

Hhm, I don't see this on Windows 8 with:
py27 nor on py34 and wxPython 3.0.2.dev77483

Werner

That’s odd. I tried building the latest snapshot (3.0.2.dev77646) and I get the same failed assert.

Poking at it in the debugger, the problem seems to be in the SIP wrapper. When supplied with page number of “1” it looks like sipParseKwdArgs is returning a garbage value for the page number, in sip_corewxNotebook.cpp, line 1525. It’s returning “0x000000ed00000000”, which is 1017907249152, and well that’s certainly out of range.

More info on my environment:

Phoenix 3.0.2.dev77646, 64-bit, built here release and debug using Visual Studio 2012 (11.0) command-line

Python 3.4.1 64-bit

Windows 8.1 64-bit

Otherwise this Phoenix build has been running fine.

If anyone is able to reproduce/confirm this or spot a problem in my setup please let me know. Thanks!

  • Adam
···

On Friday, September 12, 2014 3:23:59 AM UTC-5, werner wrote:

Hi Adam,

  On 9/11/2014 17:36, Adam Pletcher wrote:

I’m using wxPython Phoenix 3.0.2.dev77067.
Calling SetSelection or ChangeSelection on a wx.Notebook
appears to always fail an assert claiming the page number is
out of range. Attached is a small example illustrating this.

        wx._core.wxAssertionError:

C++ assertion “((nPage) < GetPageCount())” failed at
…..\src\msw\notebook.cpp( 406) in
wxNotebook::ChangeSelection(): notebook page out of range

        Is this a known problem with

a workaround? If not I can enter a bug for it. I have not
seen it mentioned in the changelogs since this dev build was
created.

  Hhm, I don't see this on Windows 8

with:

  py27 nor on py34 and wxPython 3.0.2.dev77483



  Werner