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

Eryk Sun report at bugs.python.org
Sun Jul 17 04:05:29 EDT 2016


Eryk Sun added the comment:

Thanks, Steve. I manually added this shell extension as the drop handler for Python.File. It's working with non-ANSI filenames, e.g. "αβψδ εφγη ιξκλ μνοπ ρστθ ωχυζ.txt" in a Western locale. Also, I was able to drop 939 files from the System32 directory, with a total command-line length of 32766 characters. 

However, I ran into heap corruption that crashed Explorer when dropping files from "C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\um". I used gflags to enable the page heap for Explorer and tracked the problem down to FilenameListCchLength[W|A]. It wasn't allocating space for the double quotes for paths with spaces in them. So I made the following changes:

FilenameListCchLengthW:

    length += oneLength + (wcschr(pszSource, L' ') ? 3 : 1);

FilenameListCchLengthA:

    length += oneLength + (strchr(pszSource, ' ') ? 3 : 1);

After this I was able to drop 421 files from the above-mentioned Include directory, with a total command-line length of 32737 characters.

----------

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


More information about the Python-bugs-list mailing list