Re: Bug report intelc tempfile

Mats Wichmann <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <[email protected]>
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.


_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.