Skip to content

Instantly share code, notes, and snippets.

@NelsonMinar
Created April 13, 2015 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NelsonMinar/aacf7d6dfe4e40b36c16 to your computer and use it in GitHub Desktop.
Save NelsonMinar/aacf7d6dfe4e40b36c16 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python2
"""Demonstrate a bug in unicodecsv with non-ASCII headers
In version 0.11.0 this works fine.
In version 0.11.1 it throws an error when writing the header."""
import unicodecsv
print "Unicode CSV version %s" % (unicodecsv.__version__)
fp = file("out.csv", "wb")
headers = (u'unicode\u2603',)
writer = unicodecsv.DictWriter(fp, headers)
writer.writeheader()
print "File wrote correctly!"
@NelsonMinar
Copy link
Author

Bug report for unicodecsv, see jdunck/python-unicodecsv#54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment