

def _set_content_length(self, body):
    thelen = None
    try:
        thelen = str(len(body))
    except TypeError as te:
        try:
            thelen = str(os.fstat(body.fileno()).st_size)
        except (AttributeError, OSError):
            if (self.debuglevel > 0):
                print('Cannot stat!!')
    if (thelen is not None):
        thelen.putheader('Content-Length', thelen)

dataset/ETHPy150Open OpenCobolIDE/OpenCobolIDE/open_cobol_ide/extlibs/future/backports/http/client.py HTTPConnection._set_content_length/VarMisuse@99/124 `self`->`thelen`