'The terminator might have some additional newlines before it.
There is at least one application that sends additional newlines
before headers (the python setuptools package).'

def _find_terminator(self, iterator):

    for line in iterator:
        if (not line):
            break
        line = line.strip()
        if line:
            return line
    return ''
