agw.aui traceback when closing a page in a tab container

Hi,

I receive this traceback when closing a tab in a tab container (this
is using the last version of agw.aui from svn):

Traceback (most recent call last):
  File "C:\Users\Frank\workspace\taskcoach0_74\taskcoachlib\thirdparty\aui\framemanager.py",
line 6470, in OnTabPageClose
    self._masterManager.OnTabPageClose(event)
  File "C:\Users\Frank\workspace\taskcoach0_74\taskcoachlib\thirdparty\aui\framemanager.py",
line 6490, in OnTabPageClose
    self.ClosePane(p)
  File "C:\Users\Frank\workspace\taskcoach0_74\taskcoachlib\thirdparty\aui\framemanager.py",
line 4302, in ClosePane
    self.DetachPane(to_destroy)
  File "C:\Users\Frank\workspace\taskcoach0_74\taskcoachlib\thirdparty\aui\framemanager.py",
line 4243, in DetachPane
    notebook.RemovePage(id)
  File "C:\Users\Frank\workspace\taskcoach0_74\taskcoachlib\thirdparty\aui\auibook.py",
line 2812, in RemovePage
    new_active = self._tabs.GetPage(page_idx).window
  File "C:\Users\Frank\workspace\taskcoach0_74\taskcoachlib\thirdparty\aui\auibook.py",
line 868, in GetPage
    raise Exception("Invalid Page index")
Exception: Invalid Page index

Printing the page index shows that it is -1, hence the invalid page
index. I couldn't reproduce it in the demo, but the attached patch
fixes the issue for me.

Cheers, Frank

patch.txt (512 Bytes)

HI Frank,

2009/10/10 Frank Niessink:

Hi,

I receive this traceback when closing a tab in a tab container (this
is using the last version of agw.aui from svn):

Traceback (most recent call last):
File "C:\Users\Frank\workspace\taskcoach0_74\taskcoachlib\thirdparty\aui\framemanager.py",
line 6470, in OnTabPageClose
self._masterManager.OnTabPageClose(event)
File "C:\Users\Frank\workspace\taskcoach0_74\taskcoachlib\thirdparty\aui\framemanager.py",
line 6490, in OnTabPageClose
self.ClosePane(p)
File "C:\Users\Frank\workspace\taskcoach0_74\taskcoachlib\thirdparty\aui\framemanager.py",
line 4302, in ClosePane
self.DetachPane(to_destroy)
File "C:\Users\Frank\workspace\taskcoach0_74\taskcoachlib\thirdparty\aui\framemanager.py",
line 4243, in DetachPane
notebook.RemovePage(id)
File "C:\Users\Frank\workspace\taskcoach0_74\taskcoachlib\thirdparty\aui\auibook.py",
line 2812, in RemovePage
new_active = self._tabs.GetPage(page_idx).window
File "C:\Users\Frank\workspace\taskcoach0_74\taskcoachlib\thirdparty\aui\auibook.py",
line 868, in GetPage
raise Exception("Invalid Page index")
Exception: Invalid Page index

Printing the page index shows that it is -1, hence the invalid page
index. I couldn't reproduce it in the demo, but the attached patch
fixes the issue for me.

Thank you for the patch, applied in SVN.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/