[issue27469] Unicode filename gets crippled on Windows when drag and drop

Eryk Sun report at bugs.python.org
Sun Jul 10 18:38:31 EDT 2016


Eryk Sun added the comment:

The WSH drop handler was added to resolve issue 1656675. It was chosen because it supports long filenames. OTOH, the EXE drop handler probably uses short filenames because the command line is limited to 32,768 characters. (Actually, it only uses the short name for a path element if it's longer than 12 characters or contains whitespace, which was why my example still had non-ASCII "Ā" in the filename.)

If Python.File switches to the EXE drop handler, then I think PySys_SetArgv should automatically expand short filenames. A command-line option could be added to disable automatic expansion. It would be nice to implement this change in 2.7 as well since the WSH drop handler has been used since 2.6. 

The alternative is to distribute a DLL with the launcher that implements the IPersistFile and IDropTarget interfaces [1], with support for both long filenames and Unicode. It has to be a shell extension, so AFAIK it can't be hosted in a local server process, if that's what Steve meant by embedding it in py.exe.

[1]: https://msdn.microsoft.com/en-us/library/cc144165

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27469>
_______________________________________


More information about the Python-bugs-list mailing list