header.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:nucypher-kms 作者: nucypher 项目源码 文件源码
def _read_header(self, header_path):
        """
        Reads the header file located at `header_path` and loads it from its
        msgpack format into the self.header dict.

        :param bytes/string header_path: The path to the header file

        :return: The loaded dict from the header file
        :rtype: Dict
        """
        with open(header_path, mode='rb') as f:
            # TODO: Use custom Exception (invalid or corrupt header)
            try:
                header = msgpack.loads(f.read())
            except ValueError as e:
                raise e
        return header
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号