The way that Python 3 reads in text files is different from Python 2, which means that the header column names get turned into bytes instead of strings, which means that the header check fails. The way I'm writing the ascii files, there is no encoding option. So the way I got this to work again was to change the third line here:
|
def can_read(cls, fname): |
|
ext_ok = cls.is_extension_valid(fname) |
|
with open(fname, 'rb') as f: |
|
header = f.readline().lower().split() |
|
head_ok = all([cn in header for cn in 'dates cadences xpos ypos quality'.split()]) |
to
with open(fname, 'r', encoding='utf-8') as f:
The way that Python 3 reads in text files is different from Python 2, which means that the header column names get turned into bytes instead of strings, which means that the header check fails. The way I'm writing the ascii files, there is no encoding option. So the way I got this to work again was to change the third line here:
k2sc/src/k2io.py
Lines 82 to 86 in 33eedb9
to
with open(fname, 'r', encoding='utf-8') as f: