We have a big (small) problem with the current wxPython 3.0.2.0: it raises a “wxWidgets Debug Alert” when closing a thread.
We cannot use this version because of the Debug Alert showing up all the time (for our customers). See attachment.
We depend in our current situation on version 3.0.2.0 of wxPython.
Is there anybody who can compile 3.0.2.0 32-bits with one alteration to not show Debug Alerts (minor alteration)??
PS Another option is to change to wxPython 4.0… but that brings a lot of change in our build and work environmentand possibly plenty of potential bugs.
PPS Or does anybody have a good solution how to supress these Debug Alerts in 3.0.2.0. We did quite some research but could not solve this issue.
digitale bijlage
De informatie verzonden met dit E-mail bericht is uitsluitend bestemd voor de geadresseerde. Gebruik van deze informatie door anderen dan de geadresseerde is niet toegestaan, evenals openbaarmaking, vermenigvuldiging en/of verstrekking aan derden. Alexion Software is niet aansprakelijk voor de juiste en volledige overbrenging van de inhoud van verzonden e-mail berichten, noch voor een tijdige ontvangst daarvan. De aan u verzonden digitale informatie mag uitsluitend gebruikt worden voor het desbetreffende project. De aan u verzonden digitale informatie wordt zonder enige verantwoordelijkheid onzerzijds verstrekt. Aan de door u digitaal ontvangen informatie kunnen geen rechten worden ontleend ten opzichte van Alexion Software. Het is raadzaam om de ontvangen bestanden voor het gebruik te controleren op eventuele aanwezigheid van virussen. Verlies van gegevens door het niet maken van back-ups is niet voor verantwoordelijkheid van Alexion Software.
Op al onze offertes en facturen zijn van toepassing Algemene Voorwaarden zoals gedeponeerd bij de KvK Midden-Nederland onder nummer 30174840 van ICT~Office. Deze zullen wij u op uw eerste verzoek kosteloos toesturen. Een kopie van deze algemene voorwaarden vindt u op alexion.nl/algemene-voorwaarden
We don’t
think we are doing something wrong. Creating and running a wx.App in a separate
thread should work, right? The debug message is only a warning.
Setting the
assert mode to suppress doesn’t fix the problem. In 4.0 we can fix it by using:
wx.DisableAsserts(). This function doesn’t seem to be available in wxPython
3.0.x.x
We do that but in 3.0.x.x it does not work:
c:\Users\Jasper\Desktop\wxthreaddebugtest>c:\Python27\python.exe
wxthreaddebugtest.py
Exception in thread Thread-1:
Traceback (most recent call last):
File "c:\Python27\lib\threading.py", line 801, in
__bootstrap_inner
self.run()
File "wxthreaddebugtest.py", line 10, in run
****app.SetAssertMode(wx.APP_ASSERT_SUPPRESS)
AttributeError: 'module' object has no attribute 'APP_ASSERT_SUPPRESS'
<details class='elided'>
<summary title='Show trimmed content'>···</summary>
Op donderdag 13 september 2018 19:44:54 UTC+2 schreef Robin Dunn:
>
> Try calling
>
> theApp.SetAssertMode(wx.APP_ASSERT_SUPRESS)
>
> But of course the better solution would be to find what is running on the wrong thread and stop it from doing so.
>
>
> --
> Robin Dunn
> Software Craftsman
> [http://wxPython.org](http://wxPython.org)
</details>
Thank you for looking into this. Maybe the main thread is doing the
cleanup because the wx cleanup function gets called by the ‘atexit’ module?
import wx
import atexit
atexit._exithandlers
[(, (), {})]
atexit._exithandlers[0][0] is wx.core.App_CleanUp
True
Are there still bugfix releases being made for wxPython 3.x? We kind of
need this to work right now. What about compiling wxPython without debug
messages, perhaps this is most suitable option for now? How hard is this on
Windows? Is it stable enough to use a custom build in production?
Thanks.
PS my reaction can be a bit slow because I have to ask my collegue Jasper (!)
If the process is terminating right away then there isn’t a hard need for the cleanup function to be run, so you can just remove it from the atexit list doing something like this after wx has been imported:
import atexit
try:
atexit._exithandlers.pop()
except AttributeError:
atexit.unregister(wx._core._wxPyCleanup)
···
On Tuesday, September 18, 2018 at 2:08:41 AM UTC-7, AnToine van Maarle - Alexion Software wrote:
We don’t
think we are doing something wrong. Creating and running a wx.App in a separate
thread should work, right? The debug message is only a warning.
Setting the
assert mode to suppress doesn’t fix the problem. In 4.0 we can fix it by using:
wx.DisableAsserts(). This function doesn’t seem to be available in wxPython
3.0.x.x