Python 3
-- Libraries
-- Python 3.0
# One way is to use a text wrapper to resolve the issue. e.g.
# Changing;
# data = csv.DictReader(myfile, dialect=sniffdialect)
# To;
data = csv.DictReader(io.TextIOWrapper(myfile), dialect=sniffdialect)
5.00/5.00 - (1 votes for article, provide comments and help us improve if required.)
How to resolve the error csv.Error: iterator should return strings, not bytes sometimes encountered when upgrading to Python 3.0-- Libraries
-- Python 3.0
# One way is to use a text wrapper to resolve the issue. e.g.
# Changing;
# data = csv.DictReader(myfile, dialect=sniffdialect)
# To;
data = csv.DictReader(io.TextIOWrapper(myfile), dialect=sniffdialect)