-
-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
When I try to drag and drop a file or a folder that has Unicode characters in their path, apply_dnd() will throw a UnicodeDecodeError. Here's the full exception message:
Exception ignored on calling ctypes callback function: <function apply_dnd.__init__.<locals>.py_drop_func at 0x0000026A686B23E0>
Traceback (most recent call last):
File "C:\Program Files\Python311\Lib\site-packages\pywinstyles\py_win_style.py", line 205, in py_drop_func
drop_name = file_buffer.value.decode("utf-8")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 25: invalid continuation byteMinimal reproducible example:
import tkinter, pywinstyles
from tkinter import messagebox
window = tkinter.Tk()
def print_dnd_paths(file): print(file)
pywinstyles.apply_dnd(window, print_dnd_paths)
window.mainloop()Here's a screen recording:
Screen.Recording.2024-10-27.153646.mp4
The folder's name that included Unicode characters: ăâîșț
Windows 11 23H2 (Build 22631.4391)
Python 3.11.9
pywinstyles 1.8
Metadata
Metadata
Assignees
Labels
No labels