Advertisement
Guest User

Untitled

a guest
May 24th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #!/usr/bin/env python2
  2.  
  3. """Demonstrate a bug in unicodecsv with non-ASCII headers
  4. In version 0.11.0 this works fine.
  5. In version 0.11.1 it throws an error when writing the header."""
  6.  
  7. import unicodecsv
  8. print "Unicode CSV version %s" % (unicodecsv.__version__)
  9.  
  10. fp = file("out.csv", "wb")
  11. headers = (u'unicode\u2603',)
  12. writer = unicodecsv.DictWriter(fp, headers)
  13. writer.writeheader()
  14. print "File wrote correctly!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement