Skip to content

Instantly share code, notes, and snippets.

@davidbirdsong
Created April 5, 2013 20:02
Show Gist options
  • Save davidbirdsong/5322179 to your computer and use it in GitHub Desktop.
Save davidbirdsong/5322179 to your computer and use it in GitHub Desktop.
test unicode kwargs
import pprint
v_attrs = {u'change_user': u'david',
u'path': u'/gfs/v1/cans/loko.example.13510.26654.7305-pkg1/04/046ec7dc3e',
u'publish_date': u'2013-04-05 19:44:54',
u'release_date': u'2013-04-05 19:54:28',
u'release_user': u'david',
u'sha': u'046ec7dc3e',
u'user': u'david'}
def foo(**kwargs):
pprint.pprint(kwargs)
def scrub(d):
return dict((k.encode(), d[k]) for k in d)
# v_attrs = scrub(v_attrs)
foo(**v_attrs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment