wxWidgets debug alert 2.9.5.0.b20130318

94 views
Skip to first unread message

Werner

unread,
Apr 29, 2013, 12:07:08 PM4/29/13
to wxpytho...@googlegroups.com
Hi,

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



Any hint on what module is not initialized?

Werner

Mike Driscoll

unread,
Apr 29, 2013, 4:05:45 PM4/29/13
to wxpytho...@googlegroups.com
Hi Werner,

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

I use that when I have issues with exes.

Mike

Robin Dunn

unread,
Apr 29, 2013, 11:56:06 PM4/29/13
to wxpytho...@googlegroups.com
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
http://wxPython.org

werner

unread,
Apr 30, 2013, 3:28:22 AM4/30/13
to wxpytho...@googlegroups.com
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

werner

unread,
Apr 30, 2013, 10:55:12 AM4/30/13
to wxpytho...@googlegroups.com
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.

Werner

werner

unread,
Apr 30, 2013, 11:20:42 AM4/30/13
to wxpytho...@googlegroups.com
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

werner

unread,
May 2, 2013, 2:59:53 AM5/2/13
to wxpytho...@googlegroups.com
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

werner

unread,
May 2, 2013, 4:29:10 AM5/2/13
to wxpytho...@googlegroups.com
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

Robin Dunn

unread,
May 2, 2013, 8:04:07 PM5/2/13
to wxpytho...@googlegroups.com
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.

werner

unread,
May 3, 2013, 3:48:39 AM5/3/13
to wxpytho...@googlegroups.com
Hi Robin,

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

...
> 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
dreportspyreponly.py

werner

unread,
May 3, 2013, 3:53:07 AM5/3/13
to wxpytho...@googlegroups.com
Hi Robin,

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

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

Robin Dunn

unread,
May 7, 2013, 7:18:52 PM5/7/13
to wxpytho...@googlegroups.com
werner wrote:
> Hi Robin,
>
> On 03/05/2013 02:04, Robin Dunn wrote:
>
> ...
>> 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.

werner

unread,
May 8, 2013, 2:05:12 AM5/8/13
to wxpytho...@googlegroups.com
Hi Robin,

On 08/05/2013 01:18, Robin Dunn wrote:
...
> 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
Reply all
Reply to author
Forward
0 new messages