The most common approach to this is to prefix the path with \\\\?\\ ( link ). Keep in mind that this disables certain preprocessing along the way, but nothing serious IMO.
I can also notice that on 32-bit Windows Server 2003 with Python 2.7 I had to use the Unicode prefix path (prefix u"\\\\\\\\?\\\\" or ur"\\\\?\\" ) because (as mentioned in the link ), non-Unicode API functions can still be limited to the length of MAX_PATH , even if the prefix is used.
e.g. ur"\\\\?\\c:\temp\....\abc.txt"
source share