From 65e4d5bdd1db6b9513303766d65153ff27e922f7 Mon Sep 17 00:00:00 2001 From: "Dr. Peter Poeml" Date: Tue, 3 Jun 2008 12:31:41 +0000 Subject: [PATCH] when -d (global, for debug) was used, save the body because it can't be read twice --- osc/babysitter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osc/babysitter.py b/osc/babysitter.py index 6a14a3e2..947dfadc 100644 --- a/osc/babysitter.py +++ b/osc/babysitter.py @@ -75,13 +75,15 @@ def run(prg): if hasattr(e, 'osc_msg'): print >>sys.stderr, e.osc_msg + body = None if getattr(prg.options, 'debug', None) or \ getattr(prg.conf, 'config', {}).get('debug', None): print >>sys.stderr, e.hdrs - print >>sys.stderr, e.read() + body = e.read() + print >>sys.stderr, body if e.code == 400: - msg = e.read() + msg = body or e.read() msg = msg.split('')[1] msg = msg.split('')[0] print >>sys.stderr, msg