def parseChunks(self, chunks):
        """
        Parse the output from the process to which this protocol was
        connected, which is a single unterminated line of \\0-separated
        strings giving key value pairs of the environment from that process.
        Return this as a dictionary.
        """
        environString = b''.join(chunks)
        if not environString:
            return {}
        environ = iter(environString.split(b'\0'))
        d = {}
        while 1:
            try:
                k = next(environ)
            except StopIteration:
                break
            else:
                v = next(environ)
                d[k] = v
        return d

        Parse the output from the process to which this protocol was
        connected, which is a single unterminated line of \0-separated
        strings giving key value pairs of the environment from that process.
        Return this as a dictionary.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_process.py