Skip to content

Fixed small bug

Choose a tag to compare

@carlosescri carlosescri released this 24 Nov 11:25
· 27 commits to master since this release

When trying to load a leaf value (a string) recursively you got a ValueError. This release fixes it.

Suppose you have an obj variable that is an instance of DottedCollection and a set of config paths and values in a settings collection:

for setting in settings.all():
  obj[setting.parameter] = DottedCollection.load_json(setting.value)

That would fail if setting.value is an instance of basestring.

But if you do:

obj['source.body'] = DottedCollection.load_json("something")
obj['source.body.more'] = DottedCollection.load_json('{"something": "more"}')

you will get an error because obj['source.body'] is actually an instance of basestring.