def _readlines(fname, fpointer1=open, fpointer2=open):
<EOL>try:<EOL><INDENT>with fpointer1(fname, "<STR_LIT:r>") as fobj:<EOL><INDENT>return fobj.readlines()<EOL><DEDENT><DEDENT>except UnicodeDecodeError:  <EOL><INDENT>with fpointer2(fname, "<STR_LIT:r>", encoding="<STR_LIT:utf-8>") as fobj:<EOL><INDENT>return fobj.readlines()<EOL><DEDENT><DEDENT>except:  <EOL><INDENT>raise<EOL><DEDENT>
Read all lines from file.