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

Mats Wichmann mats at wichmann.us
Tue Nov 28 09:02:35 EST 2017


On 11/28/17 01:52, 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://pairlist4.pair.net/mailman/listinfo/scons-users
> 

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?


More information about the Scons-users mailing list