def __init__(self, buf, url, code, msg, headers): check_if_any_type(buf, bytes) check_if_any_type(url, str) check_if_integral(code) check_if_any_type(msg, str) check_if_any_type(headers, dict) urllib.request.addinfourl.__init__( self, BytesIO(buf), _AboutProtocolHeader(headers), url, code ) self.msg = msg