I\'ve very recently migrated to Py 3.5. This code was working properly in Python 2.7:
with open(fname, \'rb\') as f:
lines = [x.strip() for x in f.readli
why not try opening your file as text?
with open(fname, 'rt') as f:
lines = [x.strip() for x in f.readlines()]
Additionally here is a link for python 3.x on the official page: https://docs.python.org/3/library/io.html And this is the open function: https://docs.python.org/3/library/functions.html#open
If you are really trying to handle it as a binary then consider encoding your string.