fix bytes <-> str issue in csv reading
fixes to py3 file IO