[Scons-users] scons 3.0.1: 'ascii' codec can't decode

Tim Jenness tjenness at lsst.org
Tue Nov 28 10:28:32 EST 2017



> On Nov 28, 2017, at 07:02 , Mats Wichmann <mats at wichmann.us> wrote:
> 
> On 11/28/17 01:52, mpac1234 at will-hier-weg.de <mailto:mpac1234 at will-hier-weg.de> wrote:
>> Hello,
>>  
>> when trying to move from scons 2.5.1 to scons 3.0.1 on Windows with Python 2.7.13 the following stopped working for me (does not work with python 3.6.3 either), with main.cpp being a hello world program:
>> --------------------------
>> import os
>> env = Environment(tools = ["mingw"], ENV=os.environ)
>> prog = env.Program("main", ["main.cpp"])
>> run = env.Command(Value("testrun"), prog, "$SOURCE")
>> env.Alias("run", run)
>> AlwaysBuild(run)
>> --------------------------
>>  
>> With scons 2.5.1 this works, with scons 3.0.1 it does not:
>> scons: *** [testrun] UnicodeDecodeError : 'ascii' codec can't decode byte 0x90 in position 2: ordinal not in range(128)
>> This one works
>> --------------------------
>> import os
>> env = Environment(tools = ["mingw"], ENV=os.environ)
>> prog = env.Program("main", ["main.cpp"])
>> run = env.Alias("run", prog, prog[0].abspath)
>> AlwaysBuild(run)
>> --------------------------
>> But I wondered if the first *should* work.
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://imsva91-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fpairlist4.pair.net%2fmailman%2flistinfo%2fscons%2dusers&umid=BF46B893-5F0B-7905-A7AD-4F2F609939F1&auth=f95e8f518a5a1451e680168b3f9df426ddd6fc8e-bebb967dd290038328ced203d76d5bfd7eafc7ea <https://imsva91-ctp.trendmicro.com/wis/clicktime/v1/query?url=https%3a%2f%2fpairlist4.pair.net%2fmailman%2flistinfo%2fscons%2dusers&umid=BF46B893-5F0B-7905-A7AD-4F2F609939F1&auth=f95e8f518a5a1451e680168b3f9df426ddd6fc8e-bebb967dd290038328ced203d76d5bfd7eafc7ea>
>> 
> 
> there is no ascii codec in python3 so in that context, the error message
> is expected in one sense - we can't see enough to see where it's
> actually coming from, it's presumably buried in your CommandValue method
> since the main place it comes up in in fetching text back from running
> an external command.  is it possible that your  scons3 install is
> somehow picking up python3 even in the case you don't think it is?

“ascii” codec is supported by Python 3 but can’t encode byte 0x90 (144) because it is indeed out of range for that codec.

I can’t see any explicit decodes with “ascii” in the SCons code on github at the moment (apart from test code) so I’m not sure where the “ascii” is coming from.

— 
Tim Jenness


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20171128/bd87685c/attachment-0001.html>


More information about the Scons-users mailing list