def read_file(pth, use_str=False):
    """
        读取文件, 并返回内容,
        如果读取失败,返回None

    :param pth:
    :type pth:
    :return:
    :rtype:
    """
    cont = None
    try:
        with open(u'' + pth, 'rb') as fp:
            cont = fp.read()

        if use_str:
            cont = to_str(cont)
    except Exception as err:
        print(err)
    return cont