def open_text(fname, **kwargs):
 if PY3:
  kwargs.setdefault('encoding', FS_ENCODING)
  kwargs.setdefault('errors', ENCODING_ERRORS_HANDLER)
 return open(fname, 'rt', **kwargs)

def open_text ( fname , ** kwargs ) : if PY3 : kwargs . setdefault ( 'encoding' , FS_ENCODING ) kwargs . setdefault ( 'errors' , ENCODING_ERRORS_HANDLER ) return open ( fname , 'rt' , ** kwargs )
on python 3 opens a file in text mode by using fs encoding and a proper en/decoding errors handler .