parameters: (target, default='')
return_statement: return output.decode('latin-1')
docstring: Interface to the system's file command.
  
          The function uses the -b option of the file command to have it
          omit the filename in its output. Follow the symlinks. It returns
          default in case the command should fail.
docstring_summary: Interface to the system's file command.
docstring_tokens: Interface to the system s file command .
function: def _syscmd_file(target, default=''):
  
      """ Interface to the system's file command.
  
          The function uses the -b option of the file command to have it
          omit the filename in its output. Follow the symlinks. It returns
          default in case the command should fail.
  
      """
      if sys.platform in ('dos', 'win32', 'win16'):
          # XXX Others too ?
          return default
  
      import subprocess
      target = _follow_symlinks(target)
      # "file" output is locale dependent: force the usage of the C locale
      # to get deterministic behavior.
      env = dict(os.environ, LC_ALL='C')
      try:
          # -b: do not prepend filenames to output lines (brief mode)
          output = subprocess.check_output(['file', '-b', target],
                                           stderr=subprocess.DEVNULL,
                                           env=env)
      except (OSError, subprocess.CalledProcessError):
          return default
      if not output:
          return default
      # With the C locale, the output should be mostly ASCII-compatible.
      # Decode from Latin-1 to prevent Unicode decode error.
      return output.decode('latin-1')
function_tokens: def _syscmd_file ( target , default = '' ) : if sys . platform in ( 'dos' , 'win32' , 'win16' ) : # XXX Others too ? return default import subprocess target = _follow_symlinks ( target ) # "file" output is locale dependent: force the usage of the C locale # to get deterministic behavior. env = dict ( os . environ , LC_ALL = 'C' ) try : # -b: do not prepend filenames to output lines (brief mode) output = subprocess . check_output ( [ 'file' , '-b' , target ] , stderr = subprocess . DEVNULL , env = env ) except ( OSError , subprocess . CalledProcessError ) : return default if not output : return default # With the C locale, the output should be mostly ASCII-compatible. # Decode from Latin-1 to prevent Unicode decode error. return output . decode ( 'latin-1' )