k2sc
k2sc copied to clipboard
Text files not reading in under AMCReader with Python 3
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:
https://github.com/OxES/k2sc/blob/33eedb929e0bc6524a81b41e52d8c4463f9a1c72/src/k2io.py#L82-L86
to
with open(fname, 'r', encoding='utf-8') as f: