Re: Subst should not stringify a callable if it didn't match the arguments
Bill Deegan <[email protected]>
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <CAEyG4CF7JZKc9tJS=g0uv8+0E64ePqwfR+YH=vnKUbrBjWQLyg@mail.gmail.com> |
Can you include a small repro here? On Mon, Mar 4, 2019 at 2:43 PM Mathew Robinson <[email protected]> wrote: > 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 > [email protected] > https://pairlist4.pair.net/mailman/listinfo/scons-users > _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users