def get_bin_linesep(encoding, linesep):
 if (encoding == 'utf-16'):
  return linesep.encode('utf-16')[2:]
 else:
  return linesep.encode(encoding)

def get_bin_linesep ( encoding , linesep ) : if ( encoding == 'utf-16' ) : return linesep . encode ( 'utf-16' ) [ 2 : ] else : return linesep . encode ( encoding )
simply doing linesep .