And use the wxWidgets library wrapped by SWIG.
To sum up, it is understandable to let C++ assert.
Solution: Check Python code to see if there is any wrong use of TextCtrl.