Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
komoto48g opened this issue Dec 4, 2021 · 5 comments · May be fixed by #2365
Open

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

komoto48g opened this issue Dec 4, 2021 · 5 comments · May be fixed by #2365

Comments

@komoto48g
Copy link
Contributor

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")
@swt2c
Copy link
Collaborator

swt2c commented Dec 4, 2021

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

@komoto48g
Copy link
Contributor Author

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

@swt2c
Copy link
Collaborator

swt2c commented Dec 5, 2021

Can you get a stacktrace for the crash?

@komoto48g
Copy link
Contributor Author

komoto48g commented Dec 6, 2021

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

@RobinD42
Copy link
Member

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

komoto48g added a commit to komoto48g/Phoenix that referenced this issue Dec 4, 2022
komoto48g added a commit to komoto48g/Phoenix that referenced this issue Mar 22, 2023
@komoto48g komoto48g linked a pull request Mar 22, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants