[Scons-users] env.Dictionary bug? doc problem?

Mats Wichmann mats at wichmann.us
Mon Jul 23 09:51:10 EDT 2018


On 07/22/2018 12:26 PM, Bill Deegan wrote:
> Can you check if any internal usage depends on this slicing behavior?
> 
> -Bill

Plenty of impacts.

A bunch of tests are written to the idea that Dictionary(key) returns
key's value, not a subset of the dictionary.  I'm not yet clear if
anyone expects Dictionary(key1, key2) to return a list of values.

Test errors I'm seeing often look like:

TypeError: cannot concatenate 'str' and 'dict' objects
AttributeError: 'dict' object has no attribute 'startswith':

There are also things like these in src/engine/SCons/EnvironmentTests.py:

        env3 = env1.Clone(XXX = 'x3', ZZZ = 'z3')
        assert env3.Dictionary('XXX') == 'x3'

if Dictionary('XXX') returns a dict that fails.


It also affects Dump(), but in a good way (excepting, of course, test
expectations) - I actually got here wondering why Dump doesn't take a
list of variables like so many other environment functions do.  Dump()
is like drinking from the firehose :), Dump(list-of-vars-I-care-about)
is not supported, and a series of Dump(key) calls is kind of
unsatisfying because you get back value strings instead of a pprinted
key:value pairs like in the full Dump(), so you have to do more work.



More information about the Scons-users mailing list