An internal error occured due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
...
File "/usr/lib/python2.5/httplib.py", line 349, in _read_status
raise BadStatusLine(line)
BadStatusLine
program finished with exit code 0

(The "program finished with exit code 0" line comes from buildbot logs; because of the exit code buildbot thinks everything was fine and tries to run the next step, which fails because bin/test doesn't exist.)

Okay, this is extremely weird. I can see the sys.exit(1) call in buildout sources on that machine, right after the internal error message is printed. Could the logging.shutdown() call in the finally: block somehow clear that exception? Nothing else comes to mind...

- It does only happen when buildout shall be used with a different buildout version, and buildout upgrades the zc.buildout, and restarts itself.
- In zc.buildout.buildout._maybe_upgrade the new version is called, and this one correctly returns the exit code one because of a failure. _maybe_upgrade calls sys.exit() with the correct exit code
- The Exception bubbles up the stack until zc.buildout.buildout.main, here the exceptions SystemExit are being catched and ignored

I have created a branch that does not catch the SystemError any longer. This resulted in some errors during an update that I also fixed. I'd be really happy if somebody could review it so that it gets released soon. It will make a lot of failing buildouts happy, because they'll fail at the right step.
The branch is here:
svn+ssh://svn.zope.org/repos/main/zc.buildout/branches/do3cc_exitcode