def get_file_checksum(path):
if not (sys.platform.startswith('<STR_LIT>') orsys.platform in ['<STR_LIT>', '<STR_LIT>']):<EOL><INDENT>raise OSError('<STR_LIT>')<EOL><DEDENT>assert isinstance(path, (str, _oldstr))<EOL>if not os.path.isfile(path): <EOL><INDENT>raise IOError('<STR_LIT>' %(path))<EOL><DEDENT>sub = subproc.Popen('<STR_LIT>' %(path), bufsize=-<NUM_LIT:1>, shell=True,<EOL>stdout=subproc.PIPE)<EOL>stdoutdata = sub.communicate()[<NUM_LIT:0>]<EOL>assert sub.returncode == <NUM_LIT:0><EOL>encoding = locale.getpreferredencoding()<EOL>stdoutstr = str(stdoutdata, encoding=encoding)<EOL>file_checksum = int(stdoutstr.split('<STR_LIT:U+0020>')[<NUM_LIT:0>])<EOL>logger.debug('<STR_LIT>', path, file_checksum)<EOL>return file_checksum<EOL>
Get the checksum of a file (using ``sum``, Unix-only).

    This function is only available on certain platforms.

    Parameters
    ----------
    path: str
        The path of the file.

    Returns
    -------
    int
        The checksum.

    Raises
    ------
    IOError
        If the file does not exist.