In many Windows API, the maximum path is limited to 260 characters.
However, the same APIs allow up to around 32K characters if using a
special prefix (\\?\) and unicode paths.
The modifications in this commit allows globbing to return results that
will be considered long paths in Windows (the glob pattern doesn't need
to be a long path itself). Sadly, the trick will only work in 2.7.16 and
above because of a bug in Python os.listdir when used in Windows. In
that case, the behaviour should be the same as before.
Includes tests for the new behaviour (which should be no problem in
Linux, but should had failed in Windows before applying this patch).
Should the normpath call happen in the non-use_prefix case too? It seems strange that use_prefix controls more than just prefixing but \\?\. Also, use a raw literal, so you don't have to escape all the backslashes.