asserts "traits" failed in wxStandPathsBase::Get()

wxPython,

Using wxPython 2.9.4.0, the editor I use is reporting the following wxWidgets debug alert message:

  ..\..\src\common\stdpbase.cpp(49): asserts "traits"  failed in
   wxStandPathsBase::Get() create wxApp before calling this

The editor I use is the tabbedCodeEditor from Pythoncard.
The tabbedCodeEditor works using wxpython.2.8.12.0

I narrowed the error message to the following statement in the file STCStyleEditor.py:

cfg = wx.FileConfig(localFilename=configFile, style=wx.CONFIG_USE_LOCAL_FILE)

The above statement is called many times but the debug alert message only occurs once.

Attached is a screenshot of the alert message.

I know this may be a long shot, any ideas how to solved this problem?

Thanks,
Bruce

oops.png

Make sure that the wx.App object is created before that statement is executed.

···

On 8/16/12 5:28 PM, bruce g wrote:

wxPython,

Using wxPython 2.9.4.0, the editor I use is reporting the following
wxWidgets debug alert message:

       ..\..\src\common\stdpbase.cpp(49): asserts "traits" failed in
        wxStandPathsBase::Get() create wxApp before calling this

The editor I use is the tabbedCodeEditor from Pythoncard.
The tabbedCodeEditor works using wxpython.2.8.12.0

I narrowed the error message to the following statement in the file
STCStyleEditor.py:

     cfg = wx.FileConfig(localFilename=configFile,
style=wx.CONFIG_USE_LOCAL_FILE)

The above statement is called many times but the debug alert message
only occurs once.

Attached is a screenshot of the alert message.

I know this may be a long shot, any ideas how to solved this problem?

--
Robin Dunn
Software Craftsman

To avoid the wxWidgets Alert message, I did the following within tabcodeEditor.py

Changed:
if name == ‘main’:
app = MyApplication(TabCodeEditor)
app.MainLoop()

To:

if name == ‘main’:
app = MyApplication(TabCodeEditor)

# The following statements are added here (and removed from top of file)
# after the wxApp is created to avoid the following alert message.
#   Using wxPython 2.9.4.0, got the following wxWidgets debug alert message:
#       ..\..\src\common\stdpbase.cpp(49): asserts "traits"  failed in
#       wxStandPathsBase::Get() create wxApp before calling this
# Note: tabbedCodeEditor works (no alert message) using wxpython 2.8.12.0
# --------------------------------------------------------------------------
from modules import colorizer
from PythonCard import STCStyleEditor
import codePage

app.MainLoop()

The solution may not be the best, but it works.

Thank you Robin for your suggestion.

Bruce

···

On Thursday, August 16, 2012 8:28:21 PM UTC-4, bruce g wrote:

wxPython,

Using wxPython 2.9.4.0, the editor I use is reporting the following wxWidgets debug alert message:

  ..\..\src\common\stdpbase.cpp(49): asserts "traits"  failed in
   wxStandPathsBase::Get() create wxApp before calling this

The editor I use is the tabbedCodeEditor from Pythoncard.
The tabbedCodeEditor works using wxpython.2.8.12.0

I narrowed the error message to the following statement in the file STCStyleEditor.py:

cfg = wx.FileConfig(localFilename=configFile, style=wx.CONFIG_USE_LOCAL_FILE)

The above statement is called many times but the debug alert message only occurs once.

Attached is a screenshot of the alert message.

I know this may be a long shot, any ideas how to solved this problem?

Thanks,
Bruce