Phoenix icon indicating copy to clipboard operation
Phoenix copied to clipboard

Crash when accessing wx.stc.StyledTextCtrl.DropTarget.Data

Open komoto48g opened this issue 3 years ago • 5 comments
trafficstars

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")

komoto48g avatar Dec 04 '21 12:12 komoto48g

Hmm. Possibly Windows-specific? I don't see on Linux. Does this happen on 4.0.7 for you also?

swt2c avatar Dec 04 '21 17:12 swt2c

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

komoto48g avatar Dec 05 '21 11:12 komoto48g

Can you get a stacktrace for the crash?

swt2c avatar Dec 05 '21 23:12 swt2c

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

komoto48g avatar Dec 06 '21 05:12 komoto48g

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

RobinD42 avatar Jan 31 '22 13:01 RobinD42