[Scons-users] Maximum Path Length Limitation of Windows in scons

Michael Schlenker msc at contact.de
Fri Feb 5 05:01:32 EST 2016


The issue you might see is that the '\\?\' Prefix ONLY works for the
unicode version of the Windows APIs. Python 2.x uses a mix of Unicode
and ANSI APIs internally, depending on what you pass to the functions.

The listdir() call uses a str() as can be seen from the TypeError.

So for Python 2 one would need to make sure all names are unicode when
entering the OS layer. Not sure if SCons does that somewhere, probably not.

Michael

Am 05.02.2016 um 03:08 schrieb Sally Arias:
> Hi,
> 
> I have a very long path name that exceeds windows maximum path length
> limitation that is 260. It does not work as it is. 
> 
> Workaround for Maximum Path Length Limitation:
> https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
> 
> Adding "\\?\" prefix fixes this issue on python but not on scons. 
> 
> For example, 
> 
> os.path.exists(u"\\\\?\\C:\\longpath.....")  and
> os.path.listdir(u"\\\\?\\C:\\longdir.....") work. 
> env.Install(u"\\\\?\\C:\\longpath.....", u"\\\\?\\C:\\longpath.....")
> does not work. It does not do anything.
> 
> Withou this prefix, scons generates Type Error.
> env.Install("C:\\long_path.....", "C:\\long_path.....") 
> TypeError : listdir() argument 1 must be (buffer overflow), not str
> 
> Are there any workarounds for this? Does scons support long path that
> exceeds windows maximum path length limitation? I'm using scons 2.2.0.
> Should I upgrade scons version?
> 
> 
> 
> 
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
> 

-- 
Michael Schlenker
Senior Software Engineer

CONTACT Software GmbH           Tel.:   +49 (421) 20153-80
Wiener Straße 1-3               Fax:    +49 (421) 20153-41
28359 Bremen
E-Mail: michael.schlenker at contact-software.com
http://www.contact-software.com/

Registered office: Bremen, Germany
Managing directors: Karl Heinz Zachries, Ralf Holtgrefe
Court of register: Amtsgericht Bremen HRB 1321


More information about the Scons-users mailing list