unicodecsv's API differs whether you're on Python 2 or 3, because on Python 3 it delegates to the stdlib. Unfortunately, even ignoring the use of cStringIO, the README example doesn't work in Python 3, because there's no encoding argument to reader (or writer), since the Python 3 csv module just writes strings (unicode).
I'm not sure what the best path forward is to write code that works on both Python 2 and 3. Perhaps it's to write a wrapper that gives an API that works on both. I'm not yet sure. Ideas welcome.
unicodecsv's API differs whether you're on Python 2 or 3, because on Python 3 it delegates to the stdlib. Unfortunately, even ignoring the use of
cStringIO, the README example doesn't work in Python 3, because there's noencodingargument to reader (or writer), since the Python 3 csv module just writes strings (unicode).I'm not sure what the best path forward is to write code that works on both Python 2 and 3. Perhaps it's to write a wrapper that gives an API that works on both. I'm not yet sure. Ideas welcome.