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

Plunket, Tom tom.plunket at aristocrat-inc.com
Fri Feb 5 12:17:38 EST 2016


The fact that many of the internal SCons functions use 'str()' to convert filenames will also trip up anyone who needs to use characters outside of the latin-1 character set.

I'd love to work on this but SCons is huge and I don't have a good handle on where to start. I have got the file-names.py test working, for all legal ASCII Windows filename characters except $ and #. (Escaping the characters does not help but I don't remember the specifics of the errors.)

For more information on my struggles see my post to this group on 26 Jan at 19:33 UTC+8 with the subject "Filename characters outside of latin-1".

-----Original Message-----
From: Scons-users [mailto:scons-users-bounces at scons.org] On Behalf Of Michael Schlenker
Sent: Friday, February 05, 2016 2:11 AM
To: SCons users mailing list <scons-users at scons.org>
Subject: Re: [Scons-users] Maximum Path Length Limitation of Windows in scons

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 _______________________________________________
Scons-users mailing list
Scons-users at scons.org
https://pairlist4.pair.net/mailman/listinfo/scons-users


IMPORTANT CONFIDENTIALITY NOTICE:

This E-mail(including any documents referred to in, or attached, to this E-mail) may contain information that is personal, confidential or the subject of copyright or other proprietary rights in favor of Aristocrat, its affiliates or third parties. This E-mail is intended only for the named addressee. Any privacy, confidence, copyright or other proprietary rights in favor of Aristocrat, its affiliates or third parties, is not lost because this E-mail was sent to you by mistake.

If you received this E-mail by mistake you should: (i) not copy, disclose, distribute or otherwise use it, or its contents, without the consent of Aristocrat or the owner of the relevant rights; (ii) let us know of the mistake by reply E-mail or by telephone (US 1-877-274-9661, or  AU +61 2 9013 6000); and (iii) delete it from your system and destroy all copies.

Any personal information contained in this E-mail must be handled in accordance with applicable privacy laws.

Electronic and internet communications can be interfered with or affected by viruses and other defects. As a result, such communications may not be successfully received or, if received, may cause interference with the integrity of receiving, processing or related systems (including hardware, software and data or information on, or using, that hardware or software). Aristocrat gives no assurances in relation to these matters.

If you have any doubts about the veracity or integrity of any electronic communication we appear to have sent you, please call (US 1-877-274-9661, or  AU +61 2 9013 6000) for clarification.


More information about the Scons-users mailing list