python lower than 2.6.5 will raise TypeError when dict keys are not str

I'm not sure this is of interest to anyone other than myself (since it seems the world has moved on to newer python interpreters).

Without this change, the method will raise since the keys in the kwargs are unicode, not str. This became legal in 2.6.5, but for 2.6.4 (and below?) this is the best I could come up with.