

def begin(self):
    if (self.headers is not None):
        return
    while True:
        (version, status, reason) = self._read_status()
        if (status != CONTINUE):
            break
        while True:
            skip = self.fp.readline((_MAXLINE + 1))
            if (len(skip) > _MAXLINE):
                raise LineTooLong('header line')
            skip = skip.strip()
            if (not skip):
                break
            if (self.debuglevel > 0):
                print('header:', skip)
    self.code = self.status = status
    self.reason = reason.strip()
    if (version in ('HTTP/1.0', 'HTTP/0.9')):
        self.version = 10
    elif version.startswith('HTTP/1.'):
        self.version = 11
    else:
        raise UnknownProtocol(version)
    self.headers = self.msg = parse_headers(self.fp)
    if (self.debuglevel > 0):
        for hdr in self.headers:
            print('header:', hdr, end=' ')
    tr_enc = self.headers.get('transfer-encoding')
    if (tr_enc and (tr_enc.lower() == 'chunked')):
        hdr.chunked = True
        self.chunk_left = None
    else:
        self.chunked = False
    self.will_close = self._check_close()
    self.length = None
    length = self.headers.get('content-length')
    tr_enc = self.headers.get('transfer-encoding')
    if (length and (not self.chunked)):
        try:
            self.length = int(length)
        except ValueError:
            self.length = None
        else:
            if (self.length < 0):
                self.length = None
    else:
        self.length = None
    if ((status == NO_CONTENT) or (status == NOT_MODIFIED) or (100 <= status < 200) or (self._method == 'HEAD')):
        self.length = 0
    if ((not self.will_close) and (not self.chunked) and (self.length is None)):
        self.will_close = True

dataset/ETHPy150Open OpenCobolIDE/OpenCobolIDE/open_cobol_ide/extlibs/future/backports/http/client.py HTTPResponse.begin/VarMisuse@279/345 `self`->`hdr`