Phoenix
Phoenix copied to clipboard
Crash when accessing wx.stc.StyledTextCtrl.DropTarget.Data
Operating system: Windows 10 wxPython version & source: 4.1.1 (pypi) Python version & source: 3.8.6
Description of the problem: This bug is the direct cause of the previously opened issue #1959
Accessing the Data of wx.stc.StyledTextCtrl.DropTarget property will crash, but other properties are no problem.
I will raise this as a new issue and close #1959.
Code Example (click to expand)
import wx
import wx.stc
app = wx.App()
frm = wx.Frame(None)
text = wx.stc.StyledTextCtrl(frm)
print("text.DropTarget =", text.DropTarget)
print("text.DropTarget.Data =", text.DropTarget.Data) # crash here
print("done")
Hmm. Possibly Windows-specific? I don't see on Linux. Does this happen on 4.0.7 for you also?
Thank you for checking this issue. This occurs also for wx 4.0.7 on Windows 10. Seems like a Windows-specific DnD (shell extension) problem...
Can you get a stacktrace for the crash?
No, unfortunately.
The error occurs inside the built-in method DropTarget.GetData or Data.
EDIT
When launched using switch python -Xdev -Xtracemalloc, it shows the message as follows:
Windows fatal exception: access violation
This issue has been mentioned on Discuss wxPython. There might be relevant details there:
https://discuss.wxpython.org/t/disabling-drag-and-drop-in-a-richtextctrl/35795/2