wxWidgets debug alert 2.9.5.0.b20130318

Hi,

With a py2exe'd version using 2.9.5.0.b20130318, I see this error

when closing the app on Windows XP.

![fghdajha.png|466x212](upload://ph4sGjQcJdg0KhddqEseo5t0Ojo.png)

Any hint on what module is not initialized?

Werner

Hi Werner,

···

On Monday, April 29, 2013 11:07:08 AM UTC-5, werner wrote:

Hi,

With a py2exe'd version using 2.9.5.0.b20130318, I see this error

when closing the app on Windows XP.

<img src="https://groups.google.com/group/wxpython-users/attach/55721c29bced2143/fghdajha.png?part=4&amp;authuser=0" alt="">



Any hint on what module is not initialized?



Werner

Have you tried the Dependency Walker? http://www.dependencywalker.com/

I use that when I have issues with exes.

Mike

Werner wrote:

Hi,

With a py2exe'd version using 2.9.5.0.b20130318, I see this error when
closing the app on Windows XP.

Is it only with a py2exe'd build?

Any hint on what module is not initialized?

No, I'm afraid you'll have to try and narrow it down. If I had to guess I'd say that it is probably something outside of the core wxWidgets that also uses a separate wx DLL (html, richtext, stc, etc.)

A wxModule is a class with code that should be executed when a DLL is loaded and when it is unloaded, however the autoloading code can sometimes get missed for DLLs that are loaded after the rest of the initialization code has been run, such as when a Python extension module that uses the DLL is imported later. I usually explicitly execute code to do the module initialization, but I may have missed one.

···

--
Robin Dunn
Software Craftsman

Hi Robin,

···

On 30/04/2013 05:56, Robin Dunn wrote:

Werner wrote:

Hi,

With a py2exe'd version using 2.9.5.0.b20130318, I see this error when
closing the app on Windows XP.

Is it only with a py2exe'd build?

So far I see it only in py2exe'd and only on XP myself, a client doing some testing originaly reported it. I don't know yet what OS he uses.

Will do more testing on this and see if I can find more.

BTW, it only happens since I use the above preview.

Werner

I can recreate it without py2exe and on Win 7.

It happens when I open the reporting tool which uses PythonReports, ReportLab and wx.lib.pdfviewer.

But if I run wx.lib.pdfviewer from the demo I don't see the error.

Will keep searching but if someone has some ideas - please let me know.

Werner

···

On 30/04/2013 09:28, werner wrote:

Hi Robin,

On 30/04/2013 05:56, Robin Dunn wrote:

Werner wrote:

Hi,

With a py2exe'd version using 2.9.5.0.b20130318, I see this error when
closing the app on Windows XP.

Is it only with a py2exe'd build?

So far I see it only in py2exe'd and only on XP myself, a client doing some testing originaly reported it. I don't know yet what OS he uses.

Strange, if I run the dialog for above directly then I don't see the error, I only see it when I run it from within the app and start it via a toolbar button and I don't even have to generate a report or view one, just open the dialog close it and close the app.

Werner

···

On 30/04/2013 16:55, werner wrote:

On 30/04/2013 09:28, werner wrote:

Hi Robin,

On 30/04/2013 05:56, Robin Dunn wrote:

Werner wrote:

Hi,

With a py2exe'd version using 2.9.5.0.b20130318, I see this error when
closing the app on Windows XP.

Is it only with a py2exe'd build?

So far I see it only in py2exe'd and only on XP myself, a client doing some testing originaly reported it. I don't know yet what OS he uses.

I can recreate it without py2exe and on Win 7.

It happens when I open the reporting tool which uses PythonReports, ReportLab and wx.lib.pdfviewer.

But if I run wx.lib.pdfviewer from the demo I don't see the error.

Will keep searching but if someone has some ideas - please let me know.

Hi,

Still can't narrow this down or even better find a fix or work around for it. Tried DependcyWalker and the MS System Internal Tools to see if I could find something - but these things provide information overload - at least for me.

Any chance that the error message could be improved and actually provide the Module name in question?

As mentioned before it only happens if I open my report manager from a tool bar item, if I run it by itself I don't get an error.

Could it have something to do with the way I import it when it is called from the toolbar?

     def onTBPrint(self, evt): #pylint: disable=W0613
         """Printing manager"""
         wx.BeginBusyCursor()
         modName, dlgName = "twcbsrc.controllers.dreports", "Reports"
         dlgMod = importlib.import_module(modName)
         maintDlg = getattr(dlgMod, dlgName)
         wx.EndBusyCursor()
         with maintDlg (None).view as dlg:
             dlg.ShowModal()

The controls used in this Report Manager which I don't use elsewhere are:
wx.lib.combotreebox
wx.lib.pdfviewer

PythonReports which uses:
import wx.lib.ogl as wxogl
import wx.py as wxpy

Any hint or tip on how to debug this further would be appreciated.

Werner

I just noticed the change by vadz - 15174

Could this be the cause of the issue I see, as PythonReports does use the "import wx.propgrid as wxpg" which I forgot to mention above.

Werner

···

On 02/05/2013 08:59, werner wrote:

Hi,

Still can't narrow this down or even better find a fix or work around for it. Tried DependcyWalker and the MS System Internal Tools to see if I could find something - but these things provide information overload - at least for me.

Any chance that the error message could be improved and actually provide the Module name in question?

As mentioned before it only happens if I open my report manager from a tool bar item, if I run it by itself I don't get an error.

Could it have something to do with the way I import it when it is called from the toolbar?

    def onTBPrint(self, evt): #pylint: disable=W0613
        """Printing manager"""
        wx.BeginBusyCursor()
        modName, dlgName = "twcbsrc.controllers.dreports", "Reports"
        dlgMod = importlib.import_module(modName)
        maintDlg = getattr(dlgMod, dlgName)
        wx.EndBusyCursor()
        with maintDlg (None).view as dlg:
            dlg.ShowModal()

The controls used in this Report Manager which I don't use elsewhere are:
wx.lib.combotreebox
wx.lib.pdfviewer

PythonReports which uses:
import wx.lib.ogl as wxogl
import wx.py as wxpy

Any hint or tip on how to debug this further would be appreciated.

werner wrote:

PythonReports which uses:
import wx.lib.ogl as wxogl
import wx.py as wxpy

Any hint or tip on how to debug this further would be appreciated.

I just noticed the change by vadz - 15174

Could this be the cause of the issue I see, as PythonReports does use
the "import wx.propgrid as wxpg" which I forgot to mention above.

That change only happened a couple days ago, so it would not have affected a build from March. I think you are on the right track though, the propgrid module does have a wxModule, but it also provides a function to explicitly initialize it when it was not loaded in time for the auto-init that wx does with the others.

// When wxPG is loaded dynamically after the application is already running
// then the built-in module system won't pick this one up. Add it manually.
void wxPGInitResourceModule()
{
     wxModule* module = new wxPGGlobalVarsClassManager;
     module->Init();
     wxModule::RegisterModule(module);
}

And the Python module for propgrid does call it.

However I think it is probably a case similar to this one where there is wxModule that is loaded after the initial start and which isn't getting initialized by something like the above. The part about it only happening when launching from a toolbar button seems strange though.

···

On 02/05/2013 08:59, werner wrote:

--
Robin Dunn
Software Craftsman

Hi Robin,

...

However I think it is probably a case similar to this one where there is wxModule that is loaded after the initial start and which isn't getting initialized by something like the above. The part about it only happening when launching from a toolbar button seems strange though.

Nothing to do with toolbar, but it only happens if I import the module.

dreportspyreponly.py does nothing else then import the PythonReport stuff
dreports_run.py imports the above and when running it I see the error

I sometimes also see this exception.

Hhm, just changed the first file to just import the property grid only and the error still happens.

Werner

H:\devProjectsT\aaTests\aaaWX>c:\python27\python.exe dreports_run.py
Traceback (most recent call last):
   File "dreports_run.py", line 19, in <module>
     with maintDlg (None).view as dlg:
   File "c:\dev\twcbv4\twcbsrc\controllers\dreports.py", line 50, in __init__
     **kwds)
   File "c:\dev\twcbv4\twcbsrc\controllers\base.py", line 1179, in __init__
     super(BaseController, self).__init__(**kwds)
   File "c:\dev\twcbv4\twcbsrc\controllers\base.py", line 118, in __init__
     persFile = os.path.join(wx.GetApp().persistanceLoc,
AttributeError: 'InspectableApp' object has no attribute 'persistanceLoc'

dreports_run.py (494 Bytes)

dreportspyreponly.py (260 Bytes)

···

On 03/05/2013 02:04, Robin Dunn wrote:

Hi Robin,

Forget this exception, looking at it again I see that it had happened when the import line in the test script still pointed to my app.

Sorry for the noise
Werner

···

On 03/05/2013 09:48, werner wrote:

H:\devProjectsT\aaTests\aaaWX>c:\python27\python.exe dreports_run.py
Traceback (most recent call last):
  File "dreports_run.py", line 19, in <module>
    with maintDlg (None).view as dlg:
  File "c:\dev\twcbv4\twcbsrc\controllers\dreports.py", line 50, in __init__
    **kwds)
  File "c:\dev\twcbv4\twcbsrc\controllers\base.py", line 1179, in __init__
    super(BaseController, self).__init__(**kwds)
  File "c:\dev\twcbv4\twcbsrc\controllers\base.py", line 118, in __init__
    persFile = os.path.join(wx.GetApp().persistanceLoc,
AttributeError: 'InspectableApp' object has no attribute 'persistanceLoc'

werner wrote:

Hi Robin,

...

However I think it is probably a case similar to this one where there
is wxModule that is loaded after the initial start and which isn't
getting initialized by something like the above. The part about it
only happening when launching from a toolbar button seems strange though.

Nothing to do with toolbar, but it only happens if I import the module.

dreportspyreponly.py does nothing else then import the PythonReport stuff
dreports_run.py imports the above and when running it I see the error

I sometimes also see this exception.

Hhm, just changed the first file to just import the property grid only
and the error still happens.

I found the problem, the fix will be in the next build. In the meantime you can work around it by importing wx.propgrid before the app object is created.

···

On 03/05/2013 02:04, Robin Dunn wrote:

--
Robin Dunn
Software Craftsman

Hi Robin,

...

I found the problem, the fix will be in the next build. In the meantime you can work around it by importing wx.propgrid before the app object is created.

Thanks and I can confirm that the work around does the trick

Werner

···

On 08/05/2013 01:18, Robin Dunn wrote: