original_docstring: Check if the configuration file is readable by other users.
docstring: Check if the configuration file is readable by other users.
docstring_tokens: Check if the configuration file is readable by other users .
code: def check_permissions(filename: str = None) -> None:
      """Check if the configuration file is readable by other users."""
      dname, fname = config_filename(filename)
      ffn = os.path.join(dname, fname)
      # Readable or writeable by others?
      stm = os.stat(ffn).st_mode
      if (stm & stat.S_IROTH) or (stm & stat.S_IWOTH):
          fperm = str(oct(stm)[4:])
  
          if fperm.startswith("0") and len(fperm) == 4:
              fperm = fperm[1:]
          logging.getLogger(__name__).warn(f"Configuration file '{ffn}' is readable "
                                           "by other users (permissions: {fperm}). "
                                           "You are strongly encouraged to adjust "
                                           "the file permissions: `chmod 600 {ffn}`")
code_tokens: def check_permissions ( filename : str = None ) -> None : dname , fname = config_filename ( filename ) ffn = os . path . join ( dname , fname ) stm = os . stat ( ffn ) . st_mode if ( stm & stat . S_IROTH ) or ( stm & stat . S_IWOTH ) : fperm = str ( oct ( stm ) [ 4 : ] ) if fperm . startswith ( "0" ) and len ( fperm ) == 4 : fperm = fperm [ 1 : ] logging . getLogger ( __name__ ) . warn ( f"Configuration file '{ffn}' is readable " "by other users (permissions: {fperm}). " "You are strongly encouraged to adjust " "the file permissions: `chmod 600 {ffn}`" )
short_docstring: Check if the configuration file is readable by other users.
short_docstring_tokens: Check if the configuration file is readable by other users .
comment: """Check if the configuration file is readable by other users."""$SEP$# Readable or writeable by others?