-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Closed
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Handling of a Drag-n-Drop event with tkinter causes an exception:
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\tkinter\__init__.py", line 1920, in __call__
args = self.subst(*args)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\tkinter\__init__.py", line 1605, in _substitute
e.serial = getint(nsign)
_tkinter.TclError: expected integer but got "%#"
The basic code used is this (more code is in the app, but this should be the relevant parts of the setup):
def drop(event):
print("DROP EVENT:", event) # test code to see what's delivered
root = tkinterDnD.Tk()
root.register_drop_target("*")
root.bind("<<Drop>>", drop)
The intent is to capture a file dragged from another application. With the 'register' function, this Python program and the OS indicate that the program's window is a valid place to drop a file dragged from a file manager program (specifically using Windows Explorer). After 'dropping', the error shown above is seen.
Your environment
- CPython versions tested on: Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0
- Operating system and architecture: Windows 10
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error