# HG changeset patch # User Javi Merino # Date 1380750392 -3600 # Node ID 60e578eae19d3356637ea4a0c8239abcef5641db # Parent 8e66ac9c0f0e8d72f633c862dba88dc547ac7e8e get-with-headers: don't block indefinitely if the server had an internal error If the server had an internal error and returned 500, there's nothing to read, so "response.read()" blocks indefinitely. Only output the response if there's really a response. [ original upstream message ] diff -r 8e66ac9c0f0e -r 60e578eae19d tests/get-with-headers.py --- a/tests/get-with-headers.py Thu Aug 29 09:22:13 2013 -0700 +++ b/tests/get-with-headers.py Wed Oct 02 22:46:32 2013 +0100 @@ -43,8 +43,9 @@ print "%s: %s" % (h, response.getheader(h)) if not headeronly: print - data = response.read() - sys.stdout.write(data) + if response.status != 500: + data = response.read() + sys.stdout.write(data) if twice and response.getheader('ETag', None): tag = response.getheader('ETag')