New submission from John (J5) Palmieri <[EMAIL PROTECTED]>:

# given this function

def a(**kwargs):
    pass

# this works
a(**{'b':'c'})

# this throws a format error
a(**{u'b':'c'})

I am using a web framework (TurboGears w/ genshi templating) which often
pass around dictionaries as keyword arguments in order to have 1 to 1
representation of json data and URL parameters.  This is usually fine
except when using libraries such as simplejson which encodes all of the
keywords as unicode.

Attached is a patch which is most likely just the tip of the iceberg but
hopefully it turns out to be this easy.

----------
components: Library (Lib)
files: allow_unicode_keywords.patch
keywords: patch
messages: 65567
nosy: j5
severity: normal
status: open
title: Python does not accept unicode keywords
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file10043/allow_unicode_keywords.patch

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2646>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to