__init__.py 文件源码

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

项目:girder_worker 作者: girder 项目源码 文件源码
def write(self, buf):
        """
        Write a chunk of data to the output stream in accordance with the
        chunked transfer encoding protocol.
        """
        try:
            self.conn.send(hex(len(buf))[2:].encode('utf-8'))
            self.conn.send(b'\r\n')
            self.conn.send(buf)
            self.conn.send(b'\r\n')
        except Exception:
            resp = self.conn.getresponse()
            sys.stderr.write(
                'Exception while sending HTTP chunk to %s, status was %s, '
                'message was:\n%s\n' % (self.output_spec['url'], resp.status,
                                        resp.read()))
            self.conn.close()
            self._closed = True
            raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号