def _read_password_file(b_path):
 content = None
 if os.path.exists(b_path):
  with open(b_path, 'rb') as f:
   b_content = f.read().rstrip()
  content = to_text(b_content, errors='surrogate_or_strict')
 return content

def _read_password_file ( b_path ) : content = None if os . path . exists ( b_path ) : with open ( b_path , 'rb' ) as f : b_content = f . read ( ) . rstrip ( ) content = to_text ( b_content , errors = 'surrogate_or_strict' ) return content
read the contents of a password file and return it :arg b_path: a byte string containing the path to the password file :returns: a text string containing the contents of the password file or none if no password file was present .