[Scons-users] Subst should not stringify a callable if it didn't match the arguments

Bill Deegan bill at baddogconsulting.com
Mon Mar 4 15:25:26 EST 2019

Can you include a small repro here?

On Mon, Mar 4, 2019 at 2:43 PM Mathew Robinson <chasinglogic at gmail.com>

> I was going to file a bug but then saw I should post this here first to
> confirm.
> In this branch:
> https://github.com/SCons/scons/blob/master/src/engine/SCons/Subst.py#L712
> during substitution if the callable throws a TypeError and the ListSubber
> (or StringSubber it has the same logic) is not in SUBST_RAW mode it assumes
> that it should convert it to a string. This causes hard to debug errors as
> a user if my callable throws a TypeError.
> As an example when MongoDB was going through our Python 3 upgrade we had a
> variant dir generator for the subst '$BUILD_DIR' generate the following:
> "build/<function default_variant_dir_generator at
> 0x103f17840>/mongo/base/error_codes.h"
> If a TypeError occurs in a callable and mode != SUBST_RAW I would expect
> scons to error and report this to me. If there is some use case where it
> should continue then I would expect scons to inspect the TypeError to make
> sure it's an argument failure (I could find no way to do this by reading
> the python language docs other than error message string inspection).
> Happy to file a bug if this is the recommended course.
> --
> -- Mathew Robinson (chasinglogic)
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20190304/c866e38a/attachment.html>

More information about the Scons-users mailing list