Phoenix vs. Classic Notebook Issue

When I run the attached script on Linux using wxpython Phoenix 4.0.1, I get the traceback error: “RuntimeError: wrapped C/C++ object of type NotebookDemo has been deleted” (attached) when I close the GUI frame if I change tabs before I close; where as, if I don’t change tabs, or if I change back to “TabOne” before closing the GUI frame, I don’t get an error. When I run the same script on a MACOSX running wxpython 3.0.0 I don’t get a traceback error if I change tabs or not before closing.

Is there something I’m doing wrong, or is this a bug in Phoenix 4.0.1?

Thanks,

Jeff

notebook.py (3.34 KB)

Traceback_Error.txt (373 Bytes)

Ubuntu 18.04 your script runs fine with no errors.

···

Saludos / Best regards

Mario Lacunza
Email:: mlacunza@gmail.com
Personal Website:: http://www.lacunza.biz/
Hosting:: http://mlv-host.com/
Skype: mlacunzav

Lima - Peru

Thanks Mario. What version of wxpython were you running?

Jeff

···

On Tuesday, October 2, 2018 at 2:25:00 PM UTC-5, Mario Lacunza wrote:

Ubuntu 18.04 your script runs fine with no errors.

Saludos / Best regards

Mario Lacunza
Email:: mlac...@gmail.com
Personal Website:: http://www.lacunza.biz/
Hosting:: http://mlv-host.com/
Skype: mlacunzav

Lima - Peru

El mar., 2 de oct. de 2018 a la(s) 13:56, jeff....@gmail.com escribió:

When I run the attached script on Linux using wxpython Phoenix 4.0.1, I get the traceback error: “RuntimeError: wrapped C/C++ object of type NotebookDemo has been deleted” (attached) when I close the GUI frame if I change tabs before I close; where as, if I don’t change tabs, or if I change back to “TabOne” before closing the GUI frame, I don’t get an error. When I run the same script on a MACOSX running wxpython 3.0.0 I don’t get a traceback error if I change tabs or not before closing.

Is there something I’m doing wrong, or is this a bug in Phoenix 4.0.1?

Thanks,

Jeff

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

I have both Python 2 & 3 installed:

mario@pc:~$ python
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
[GCC 7.3.0] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import wx
print wx.version
3.0.2.0

[2]+ Detenido python
mario@pc:~$ python3
Python 3.6.6 (default, Sep 12 2018, 18:26:19)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import wx
print(wx.version)
4.0.1

···

Saludos / Best regards

Mario Lacunza
Email:: mlacunza@gmail.com
Personal Website:: http://www.lacunza.biz/
Hosting:: http://mlv-host.com/
Skype: mlacunzav

Lima - Peru

It sounds like the EVT_NOTEBOOK_PAGE_CHANGED and EVT_NOTEBOOK_PAGE_CHANGING events are being processed after the notebook has started to be or has already been deleted, and the events are probably initially sent when the notebook is deleting the pages and it needs to switch the current page to one that still exists. The delay in processing the events could stem from differences in the GTK version, like gtk2 vs gtk3, or it’s not unheard of for different point releases of gtk to have behavioral differences like this. It could also be interference from a theme engine or something. In any case, the workaround is easy, just add something like this to the beginning of those handlers:

if not self:

    return
···

On Tuesday, October 2, 2018 at 11:56:48 AM UTC-7, jeff.kueng@gmail.com wrote:

When I run the attached script on Linux using wxpython Phoenix 4.0.1, I get the traceback error: “RuntimeError: wrapped C/C++ object of type NotebookDemo has been deleted” (attached) when I close the GUI frame if I change tabs before I close; where as, if I don’t change tabs, or if I change back to “TabOne” before closing the GUI frame, I don’t get an error. When I run the same script on a MACOSX running wxpython 3.0.0 I don’t get a traceback error if I change tabs or not before closing.

Is there something I’m doing wrong, or is this a bug in Phoenix 4.0.1?

Robin

Thanks Robin that worked!

Jeff

···

On Wednesday, October 3, 2018 at 5:17:09 PM UTC-5, Robin Dunn wrote:

On Tuesday, October 2, 2018 at 11:56:48 AM UTC-7, jeff....@gmail.com wrote:

When I run the attached script on Linux using wxpython Phoenix 4.0.1, I get the traceback error: “RuntimeError: wrapped C/C++ object of type NotebookDemo has been deleted” (attached) when I close the GUI frame if I change tabs before I close; where as, if I don’t change tabs, or if I change back to “TabOne” before closing the GUI frame, I don’t get an error. When I run the same script on a MACOSX running wxpython 3.0.0 I don’t get a traceback error if I change tabs or not before closing.

Is there something I’m doing wrong, or is this a bug in Phoenix 4.0.1?

It sounds like the EVT_NOTEBOOK_PAGE_CHANGED and EVT_NOTEBOOK_PAGE_CHANGING events are being processed after the notebook has started to be or has already been deleted, and the events are probably initially sent when the notebook is deleting the pages and it needs to switch the current page to one that still exists. The delay in processing the events could stem from differences in the GTK version, like gtk2 vs gtk3, or it’s not unheard of for different point releases of gtk to have behavioral differences like this. It could also be interference from a theme engine or something. In any case, the workaround is easy, just add something like this to the beginning of those handlers:

if not self:
    return

Robin

Thanks Mario, Now I understand.

···

On Wednesday, October 3, 2018 at 1:26:34 PM UTC-5, Mario Lacunza wrote:

I have both Python 2 & 3 installed:

mario@pc:~$ python
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
[GCC 7.3.0] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import wx
print wx.version
3.0.2.0

[2]+ Detenido python
mario@pc:~$ python3
Python 3.6.6 (default, Sep 12 2018, 18:26:19)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import wx
print(wx.version)
4.0.1

Saludos / Best regards

Mario Lacunza
Email:: mlac...@gmail.com
Personal Website:: http://www.lacunza.biz/
Hosting:: http://mlv-host.com/
Skype: mlacunzav

Lima - Peru

El mié., 3 de oct. de 2018 a la(s) 13:12, jeff....@gmail.com escribió:

Thanks Mario. What version of wxpython were you running?

Jeff

On Tuesday, October 2, 2018 at 2:25:00 PM UTC-5, Mario Lacunza wrote:

Ubuntu 18.04 your script runs fine with no errors.

Saludos / Best regards

Mario Lacunza
Email:: mlac...@gmail.com
Personal Website:: http://www.lacunza.biz/
Hosting:: http://mlv-host.com/
Skype: mlacunzav

Lima - Peru

El mar., 2 de oct. de 2018 a la(s) 13:56, jeff....@gmail.com escribió:

When I run the attached script on Linux using wxpython Phoenix 4.0.1, I get the traceback error: “RuntimeError: wrapped C/C++ object of type NotebookDemo has been deleted” (attached) when I close the GUI frame if I change tabs before I close; where as, if I don’t change tabs, or if I change back to “TabOne” before closing the GUI frame, I don’t get an error. When I run the same script on a MACOSX running wxpython 3.0.0 I don’t get a traceback error if I change tabs or not before closing.

Is there something I’m doing wrong, or is this a bug in Phoenix 4.0.1?

Thanks,

Jeff

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.