'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.'

def parseChunks(self, chunks):

    environString = ''.join(chunks)
    if (not environString):
        return {}
    environ = iter(environString.split('\x00'))
    d = {}
    while 1:
        try:
            k = next(environ)
        except StopIteration:
            break
        else:
            v = next(environ)
            d[k] = v
    return d
