Created
April 13, 2015 20:20
-
-
Save NelsonMinar/aacf7d6dfe4e40b36c16 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report for unicodecsv, see jdunck/python-unicodecsv#54