有人可以向我解释为什么这会引发 ValueError 吗?(使用 Python 2.7)
from django.utils.translation import ugettext as _
...
template = _('► %(user)s, random text here @[%(friend_id)s] more random text ◄◄◄'.decode('utf-8')) % {'user': friend_profile.user.first_name, 'friend_id': user.id}
这是错误(由芹菜错误电子邮件发送):
File "/var/www/myapp/apps/app/tasks.py", line 54, in notify_friends_new_invite
template=_('��� %(user)s, random text here @[%(friend_id)s] more random text ���������'.decode('utf-8')) % {'user': friend_profile.user.first_name, 'friend_id': user.id},
ValueError: unsupported format character '(' (0x28) at index 3