[Scons-users] SCons 3.0.0 and Util.py

Bassem Girgis brgirgis at gmail.com
Wed Oct 4 20:09:21 EDT 2017


It looks like I had a bad link in the path I was trying to install. SCons
3.0.0 would give the following error with Python 2.7.13, which is
informative.

>> scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
Install directory: "bin" as "install/bin"
scons: *** [install/bin] CopytreeError : [('bin/badlink',
'install/bin/badlink', "[Errno 2] No such file or directory:
'bin/badlink'")]

And the following error with Python 3.6.2, which doesn't tell much.

>> scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
Install directory: "bin" as "install/default/bin"
scons: *** [install/default/bin] TypeError : decoding to str: need a
bytes-like object, NoneType found
Traceback (most recent call last):
  File "/usr/lib/scons-3.0.0/SCons/Taskmaster.py", line 255, in execute
    self.targets[0].build()
  File "/usr/lib/scons-3.0.0/SCons/Node/__init__.py", line 750, in build
    self.get_executor()(self, **kw)
  File "/usr/lib/scons-3.0.0/SCons/Executor.py", line 396, in __call__
    return _do_execute_map[self._do_execute](self, target, kw)
  File "/usr/lib/scons-3.0.0/SCons/Executor.py", line 127, in
execute_action_list
    status = act(*args, **kw)
  File "/usr/lib/scons-3.0.0/SCons/Action.py", line 709, in __call__
    stat = self.execute(target, source, env, executor=executor)
  File "/usr/lib/scons-3.0.0/SCons/Action.py", line 1207, in execute
    result = SCons.Errors.convert_to_BuildError(result, exc_info)
  File "/usr/lib/scons-3.0.0/SCons/Errors.py", line 203, in
convert_to_BuildError
    exc_info=exc_info)
  File "/usr/lib/scons-3.0.0/SCons/Errors.py", line 98, in __init__
    self.errstr = SCons.Util.to_str(errstr)
  File "/usr/lib/scons-3.0.0/SCons/Util.py", line 1623, in to_str
    return str (s, 'utf-8')
TypeError: decoding to str: need a bytes-like object, NoneType found
scons: building terminated because of errors.

Please find attached a simple project to replicate this issue. Some how
scons 2.5.1 had no problem ignoring the bad links silently. Not sure what
is the intended behavior here would be. But I like the scons 3.0.0 with
python 2.7.13 the best because it pinned point the issue for me and didn't
let such a dead link go unnotced like scons 2.5.1.

Best regards,
Bassem


Bassem Girgis, PhD

Email: brgirgis at gmail.com

On Tue, Oct 3, 2017 at 4:46 PM, Bassem Girgis <brgirgis at gmail.com> wrote:

> Hi All,
>
> I'm trying to migrate to SCons 3.0.0 to use python 3.6 as my only python
> installation. In doing so I ran into the issue shown below. It lookd like
> the to_str() function in Util.py is not expecting None and it got one. From
> my end, it looks like a directory install is what caused it. Editing the
> to_str() function to return empty str in that case solved the issue.
> However, I'm not sure if the issue is rather in the Install() builder that
> returned a None from the executer.
>
> Install directory: "to/project/runtime/linx64" as
> "to/install/linx64/lib/linx64"
> --------------> None
> scons: *** [to/install/linx64/lib/linx64] TypeError : decoding to str:
> need a bytes-like object, NoneType found
> Traceback (most recent call last):
>   File "/usr/lib/scons-3.0.0/SCons/Taskmaster.py", line 255, in execute
>     self.targets[0].build()
>   File "/usr/lib/scons-3.0.0/SCons/Node/__init__.py", line 750, in build
>     self.get_executor()(self, **kw)
>   File "/usr/lib/scons-3.0.0/SCons/Executor.py", line 396, in __call__
>     return _do_execute_map[self._do_execute](self, target, kw)
>   File "/usr/lib/scons-3.0.0/SCons/Executor.py", line 127, in
> execute_action_list
>     status = act(*args, **kw)
>   File "/usr/lib/scons-3.0.0/SCons/Action.py", line 709, in __call__
>     stat = self.execute(target, source, env, executor=executor)
>   File "/usr/lib/scons-3.0.0/SCons/Action.py", line 1207, in execute
>     result = SCons.Errors.convert_to_BuildError(result, exc_info)
>   File "/usr/lib/scons-3.0.0/SCons/Errors.py", line 203, in
> convert_to_BuildError
>     exc_info=exc_info)
>   File "/usr/lib/scons-3.0.0/SCons/Errors.py", line 98, in __init__
>     self.errstr = SCons.Util.to_str(errstr)
>   File "/usr/lib/scons-3.0.0/SCons/Util.py", line 1624, in to_str
>     return str (s, 'utf-8')
> TypeError: decoding to str: need a bytes-like object, NoneType found
> scons: building terminated because of errors.
>
>
> Bassem Girgis, PhD
>
> Email: brgirgis at gmail.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20171004/b6f14243/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.tar.gz
Type: application/x-gzip
Size: 586 bytes
Desc: not available
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20171004/b6f14243/attachment-0001.bin>


More information about the Scons-users mailing list