dryfish wrote:
> Python 3.1.1 doesn't seem to be happy with the use of gzip.open with
> csv.reader.
> 
> Using this:
> 
> import gzip, csv, sys
> 
> data = csv.reader(gzip.open(sys.argv[1]))
> for row in data:
>     print(row)
> 
> Will give this:
> 
> Traceback (most recent call last):
>   File "./a.py", line 6, in <module>
>     for row in data:
> _csv.Error: iterator should return strings, not bytes (did you open
> the file in text mode?)

See codecs.EncodedFile().

Stefan
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to