I have the following code to read a gzipped file in python and it has been working without any error in Python 2. I installed Python 3 and now am getting error: TypeError: a bytes-like object is required, not 'str'. I am not sure what needs to be changed to fix this issue?
with gzip.open(wv.inpfile, 'rb') as fin:
for line in fin:
if (line_count == 0):
record_columns = line.strip('\n').split('\t')