ccpgames / alviss

Configuration file reader with some nifty bells and whistles added
MIT License
0 stars 0 forks source link

Keys that are just numbers get resolved as int and then trigger an attribute exception since int's are not str's #10

Open CCP-Zeulix opened 1 month ago

CCP-Zeulix commented 1 month ago

That is to say, there's an assumption in the code that keys are str and thus errors like "int has no attribute startswith" and the likes.

Quick and easy to fix by just casting all keys to strings after they're read (although that's may not be optimal, because the code using Alviss to read yaml/json may be expecting int keys but now gets str and needs to cast to int... :-/

There's also a workaround where you just surround the key with quotes to force them to be a string.