[Scons-users] Bug report intelc tempfile
Mats Wichmann
mats at wichmann.us
Sun Dec 1 16:09:58 EST 2019
On 11/29/19 10:18 AM, Mats Wichmann wrote:
> On 11/29/19 9:45 AM, Mats Wichmann wrote:
>> On 11/29/19 9:40 AM, Oscar Anson wrote:
>>> We also hit the same issue when upgrading from scons 3.0.0 to 3.1.1
>>>
>>> We are using also the Intel compiler and I had to set a space char as
>>> the join value.
>>
>> Hmmm, so maybe it's falling over to a newline too easily. As I recall
>> the comments at the time, it was supposed to still default to space
>> but be able to switch if the lines were going to be too long. Perhaps
>> I'm not remembering right. Or maybe if the intelc case calls the msvc
>> base code it ought to override the setting?
>
> I think this is just logically inconsistent - the code that uses this does:
>
>
> fd, tmp = tempfile.mkstemp(suffix, text=True)
> ...
> join_char = env.get('TEMPFILEARGJOIN',' ')
> os.write(fd, bytearray(join_char.join(args) + "\n",'utf-8'))
> os.close(fd)
>
>
> so it's getting a file from mkstemp explicitly saying open it in text
> mode, then forcing the thing it's going to write out to bytes... that
> just doesn't sound right.
and... this conclusion was bogus, because mkstemp returns an OS-level
file desriptor, and os.write on such *requires* a bytes object, it's not
like using the higher-level open which returns a file object.
we could do an os.fdopen on that descriptor to get a file object, but
that's another story. right now, converting the args to bytearray is
correct.
More information about the Scons-users
mailing list