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

mpac1234 at will-hier-weg.de mpac1234 at will-hier-weg.de
Wed Nov 29 06:47:30 EST 2017


Hi Tim,

thanks for your reply. As far as I can see get_contents calls get_text_contents
scons\engine\scons\node\python.py(166)get_csig()
165 pass
--> 166 contents = self.get_contents()
167 self.get_ninfo().csig = contents

scons\engine\scons\node\python.py(143)get_contents()
142 def get_contents(self):
--> 143 text_contents = self.get_text_contents()
144 try:

scons\engine\scons\node\python.py(135)get_text_contents()
134 contents = str(self.value)
--> 135 for kid in self.children(None):
136 contents = contents + kid.get_contents().decode()

Is not the root problem to represent arbitrary data as ASCII? This is how this stuff looks like in SCons 2.5.1:
--------------
for kid in self.children(None):
contents = contents + kid.get_contents()
return contents

get_contents = get_text_contents ###TODO should return 'bytes' value
--------------
get_contents and get_text_contents are the same. No attempts to decode / encode.
 
 

> Gesendet: Dienstag, 28. November 2017 um 18:02 Uhr
> Von: "Tim Jenness" <tjenness at lsst.org>
> An: "SCons users mailing list" <scons-users at scons.org>
> Betreff: Re: [Scons-users] scons 3.0.1: 'ascii' codec can't decode
> That line came up the other day with a different bug. I was wondering why it wasn’t using `kid.get_text_contents()`.
> 
> > On Nov 28, 2017, at 08:26 , <mpac1234 at will-hier-weg.de> <mpac1234 at will-hier-weg.de> wrote:
> >
> >
> > I do not know why or how, but it seems the binary content of files appears as a python string in SCons/engine/node/Python.py:136 and decoding this as ascii fails.
> > Changing SCons/engine/Node/Python.py:135,136 from
> > for kid in self.children(None):
> > contents = contents + kid.get_contents().decode()
> > to
> > for kid in self.children(None):
> > contents = contents + kid.get_contents().encode('hex').decode()
> > makes the errors ('ascii' codec can't decode byte xxxx in position x: ordinal not in range(128)) disappear. But I have no idea if this is a valid fix or if it breaks anything else.
> >
> >
> > _______________________________________________
> > 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=4DD1EB76-5F0C-A405-82E3-C262848FEB2B&> auth=f95e8f518a5a1451e680168b3f9df426ddd6fc8e-ded3bf46fcf4237a27f3aaeff727822f03e7c624


More information about the Scons-users mailing list