“keywords must be strings”

Bugfixing! Here’s interesting one:

def some_function(**kwargs): 
    pass

some_function(**{u"this_is_unicode_keyword":"value"})

Passing unicode keyword to function works in Python 2.6.6 (and probably above), but doesn’t work in Python 2.6.2 (and probably below)–it throws TypeError: some_function() keywords must be strings. Of course it took some digging to get from generic “something went wrong somewhere” error report, to this specific cause. Turns out there was at least one affected place in SuRF, which is fixed now.

Advertisements