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

Matthias Lieberei mpac1234 at will-hier-weg.de
Fri Dec 8 16:01:18 EST 2017


Hi,

this:
scons: *** [2017-12-08 21:58:35.968302] UnicodeDecodeError : 'ascii' codec can't decode byte 0xf8 in position 96: ordinal not in range(128)
also happens on Linux with python 3.6.3 and scons 3.0.1
with a simpler SConstruct
--------------------------------
import datetime                                                                                                                                                                         
prog = Program("hello", ["main.cpp"])                                                                                                                                                   
run = Command(Value(datetime.datetime.now()), prog, "hello")                                                                                                                            
Alias("run", run)
--------------------------------

Regards
ml

Gesendet: Freitag, 01. Dezember 2017 um 08:44 Uhr
Von: mpac1234 at will-hier-weg.de
An: scons-users at scons.org
Betreff: Re: [Scons-users] scons 3.0.1: 'ascii' codec can't decode
Hi,

thank you for the effort. The SConstruct that was used in your test does not provoke the issue. I included a SConstruct that fixes the problem for me in the original post. Unfortunately, I cannot apply the fix at every point where this issue haunts me. This is the SConstruct that throws the error (in my setup):
-----------------------------------------
import os
env = Environment(tools = ["mingw"], ENV=os.environ)
prog = env.Program("main", ["main.cpp"])
run = env.Command(Value("test"), prog, "main")
env.Alias("run", run)
env.AlwaysBuild(run)
-----------------------------------------
Sorry for causing confusion. Could you please try again, using above SConstruct?
I encounter this issue with Python 2.7.13 on Windows 7.

$ python --version
Python 2.7.13
$ scons --version
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:\\seu\\xe54\\Chocolatey\\lib\\scons\\script\\..\\engine\\SCons']
Copyright (c) 2001 - 2017 The SCons Foundation
$ cat SConstruct
import os
env = Environment(tools = ["mingw"], ENV=os.environ)
prog = env.Program("main", ["main.cpp"])
run = env.Command(Value("test"), prog, "main")
env.Alias("run", run)
env.AlwaysBuild(run)
$ scons run
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: *** [test] UnicodeDecodeError : 'ascii' codec can't decode byte 0x90 in position 2: ordinal not in range(128)
scons: building terminated because of errors.
 

Gesendet: Donnerstag, 30. November 2017 um 03:39 Uhr
Von: "Bill Deegan" <bill at baddogconsulting.com>
An: "SCons users mailing list" <scons-users at scons.org>
Betreff: Re: [Scons-users] scons 3.0.1: 'ascii' codec can't decode

I'm not seeing the failure when I run on my mac:
 
$ venv/bin/scons -f SConstruct_Broken run
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o main.o -c main.cpp
g++ -o main.exe main.o
/Users/bdbaddog/devel/scons/bugs/ascii_codec_cant/main.exe
Hello, world!
scons: done building targets.
 
$ cat SConstruct_Broken
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)
 
 
$ venv/bin/scons --version
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: ['/Users/bdbaddog/devel/scons/bugs/ascii_codec_cant/venv/lib/python2.7/site-packages/scons-3.0.1/SCons']
Copyright (c) 2001 - 2017 The SCons Foundation
 
 
 
On Wed, Nov 29, 2017 at 1:10 PM, Fred Wright <fw at fwright.net[mailto:fw at fwright.net]> wrote:
On Wed, 29 Nov 2017, Bill Deegan wrote:

> Yes.
> That's some logic from the py2/3 port that's not quite right it seems.
>
> Very surprised our test suite didn't catch something this simple.
> I'll take a look at the logic.
> I have a fix for similar in one of my sandboxes, but it's breaking a lot of
> the tests (which themselves could be wrong), thought that fix is for py3.5+
> issue.
>
> In essence, all info used to create a signature from files/values/etc
> should be bytes and not unicode and not treated as a string.
> Looks like the code is not doing that in at least 2 places.

Have you looked at?:

Practical Python porting for systems programmers
http://www.catb.org/esr/faqs/practical-python-porting/[http://www.catb.org/esr/faqs/practical-python-porting/[http://www.catb.org/esr/faqs/practical-python-porting/]]

In particular, the section titled "Fix up string/unicode mixing"?

Fred Wright

_______________________________________________
Scons-users mailing list
Scons-users at scons.org[mailto:Scons-users at scons.org]
https://pairlist4.pair.net/mailman/listinfo/scons-users_______________________________________________[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[https://pairlist4.pair.net/mailman/listinfo/scons-users][https://pairlist4.pair.net/mailman/listinfo/scons-users[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[https://pairlist4.pair.net/mailman/listinfo/scons-users]
 
 


More information about the Scons-users mailing list