Malformed dictionary causing SyntaxError in Python 2.6