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

Tim Jenness tjenness at lsst.org
Fri Dec 8 16:21:42 EST 2017


What locale are you using? 0xf8 in latin-1 is ‘ø’ but 0xf8 is not a valid byte for a utf-8 encoding (not that that matters when it’s being forced to ascii decoding).

> On Dec 8, 2017, at 14:01, Matthias Lieberei <mpac1234 at will-hier-weg.de> wrote:
> 
> 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 <mailto:mpac1234 at will-hier-weg.de>
> An: scons-users at scons.org <mailto: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/ <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>[mailto:Scons-users at scons.org <mailto: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%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5bhttps%3a%2f%2fpairlist4.pair.net%2fmailman%2flistinfo%2fscons%2dusers%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5d&umid=FAF10304-5FDA-7C05-9BDB-2C217C0F989D&auth=f95e8f518a5a1451e680168b3f9df426ddd6fc8e-d7a00a6f119d0ee9e712fca892ab6b0bac082d37 <https://imsva91-ctp.trendmicro.com/wis/clicktime/v1/query?url=https%3a%2f%2fpairlist4.pair.net%2fmailman%2flistinfo%2fscons%2dusers%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5bhttps%3a%2f%2fpairlist4.pair.net%2fmailman%2flistinfo%2fscons%2dusers%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5f%5d&umid=FAF10304-5FDA-7C05-9BDB-2C217C0F989D&auth=f95e8f518a5a1451e680168b3f9df426ddd6fc8e-d7a00a6f119d0ee9e712fca892ab6b0bac082d37> Scons-users mailing list Scons-users at scons.org <mailto: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%5bhttps%3a%2f%2fpairlist4.pair.net%2fmailman%2flistinfo%2fscons%2dusers%5d%5bhttps%3a%2f%2fpairlist4.pair.net%2fmailman%2flistinfo%2fscons%2dusers%5bhttps%3a%2f%2fpairlist4.pair.net%2fmailman%2flistinfo%2fscons%2dusers%5d%5d&umid=FAF10304-5FDA-7C05-9BDB-2C217C0F989D&auth=f95e8f518a5a1451e680168b3f9df426ddd6fc8e-4675f0e42c6d3d1317c25d5320b17dbd389ae334 <https://imsva91-ctp.trendmicro.com/wis/clicktime/v1/query?url=https%3a%2f%2fpairlist4.pair.net%2fmailman%2flistinfo%2fscons%2dusers%5bhttps%3a%2f%2fpairlist4.pair.net%2fmailman%2flistinfo%2fscons%2dusers%5d%5bhttps%3a%2f%2fpairlist4.pair.net%2fmailman%2flistinfo%2fscons%2dusers%5bhttps%3a%2f%2fpairlist4.pair.net%2fmailman%2flistinfo%2fscons%2dusers%5d%5d&umid=FAF10304-5FDA-7C05-9BDB-2C217C0F989D&auth=f95e8f518a5a1451e680168b3f9df426ddd6fc8e-4675f0e42c6d3d1317c25d5320b17dbd389ae334>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org <mailto: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%5bhttps%3a%2f%2fpairlist4.pair.net%2fmailman%2flistinfo%2fscons%2dusers%5d&umid=FAF10304-5FDA-7C05-9BDB-2C217C0F989D&auth=f95e8f518a5a1451e680168b3f9df426ddd6fc8e-f9e0010498a0c003d04955d26eac6886329a4554 <https://imsva91-ctp.trendmicro.com/wis/clicktime/v1/query?url=https%3a%2f%2fpairlist4.pair.net%2fmailman%2flistinfo%2fscons%2dusers%5bhttps%3a%2f%2fpairlist4.pair.net%2fmailman%2flistinfo%2fscons%2dusers%5d&umid=FAF10304-5FDA-7C05-9BDB-2C217C0F989D&auth=f95e8f518a5a1451e680168b3f9df426ddd6fc8e-f9e0010498a0c003d04955d26eac6886329a4554>
>  
>  
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org <mailto: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=FAF10304-5FDA-7C05-9BDB-2C217C0F989D&auth=f95e8f518a5a1451e680168b3f9df426ddd6fc8e-de1813fdf6ea435d9a12e5337ff3d12ea4c27764 <https://imsva91-ctp.trendmicro.com/wis/clicktime/v1/query?url=https%3a%2f%2fpairlist4.pair.net%2fmailman%2flistinfo%2fscons%2dusers&umid=FAF10304-5FDA-7C05-9BDB-2C217C0F989D&auth=f95e8f518a5a1451e680168b3f9df426ddd6fc8e-de1813fdf6ea435d9a12e5337ff3d12ea4c27764>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20171208/6b929887/attachment-0001.html>


More information about the Scons-users mailing list