[Scons-users] SCons interfers with the constructor of io.TextIOWrapper when pywin32 is installed

Bill Deegan bill at baddogconsulting.com
Thu Sep 6 00:01:09 EDT 2018


In a lot of cases non-trivial python builders should be moved to a script
which runs outside SCons.
This way you can avoid the GIL.
Additionally there have been some race conditions between file closing and
reference on windows which seem to show up more frequently for non-trivial
python builder logic inside scons.
(Think parsing and writing a complex file such as XML)..

BTW. the io wrapping is intended to ensure that file handles aren't shared
between threads for such which can cause some race conditions on Win32..

-Bill

On Thu, Aug 23, 2018 at 3:49 PM François Beaune <dictoon at gmail.com> wrote:

> Interesting. I wonder if io.TextIOWrapper shouldn't simply be excluded
> from the wrapping since it's itself a wrapper?
>
> Franz
>
> On Thu, Aug 23, 2018 at 9:47 PM Mats Wichmann <mats at wichmann.us> wrote:
>
>> On 08/23/2018 11:12 AM, François Beaune wrote:
>> > Hi,
>> >
>> > I'm using scons v3.0.1 under Windows 10:
>> >
>> > SCons by Steven Knight et al.:
>> >         script: v3.0.1.74b2c53bc42290e911b334a6b44f187da698a668,
>> 2017/11/14
>> > 13:16:53, by bdbaddog on hpmicrodog
>> >         engine: v3.0.1.74b2c53bc42290e911b334a6b44f187da698a668,
>> 2017/11/14
>> > 13:16:53, by bdbaddog on hpmicrodog
>> >         engine path:
>> > ['c:\\python36\\lib\\site-packages\\scons-3.0.1\\SCons']
>> > Copyright (c) 2001 - 2017 The SCons Foundation
>> >
>> > Under (and only under) Python 3.x, when the pywin32 Python module is
>> > installed, scons wraps a number of classes from the io module
>> > (io.BufferedReader, io.BufferedWriter, io.BufferedRWPair,
>> > io.BufferedRandom, io.TextIOWrapper) in order to run some custom code
>> when
>> > they are constructed. This is done in SCons\Platform\win32.py lines
>> 83-92.
>>
>> I've run into a couple of problems with this wrapping as well.  One
>> actually made it into an issue:
>>
>> https://github.com/SCons/scons/issues/3136
>>
>> which is clearly not the same, but adds to wondering about this wrapping.
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180906/3719bfd4/attachment.html>


More information about the Scons-users mailing list