--- /tmp/cgi.py 2014-06-10 12:18:31.029412177 +0200 +++ /usr/lib/python3.3/cgi.py 2014-06-10 13:45:49.015208848 +0200 @@ -839,7 +839,7 @@ if not line: self.done = -1 break - if line.endswith(b"--") and last_line_lfend: + if line.startswith(b"--") and last_line_lfend: strippedline = line.strip() if strippedline == next_boundary: break