Traceback (most recent call last):
File "<stdin>", line 35, in <module>
File "<stdin>", line 27, in getTags
KeyError: u'\ufeff\u0413\u043e\u0432\u043e\u0440\u044f\u0442,'
>Unlike sequences, which are indexed by a range of numbers, dictionaries are indexed by keys, which can be >>>>>any immutable type<<<<<<; strings and numbers can always be keys
$ python
Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> mydict={u"информация": u"питон это круто" }
>>> print mydict[u"информация"]
питон это круто
два варианта, либо явно кастовать строки к utf8 а-ля
u'строка'
либо в заглавии скрипта указать:
$ cat ./test.py
#/usr/bin/python
# -*- coding: utf-8 -*-
print 'привет мир'