From 193ec74260610929ece1a52fd2ba3924683fd773 Mon Sep 17 00:00:00 2001 From: Albert Zeyer Date: Fri, 13 May 2011 21:48:27 +0200 Subject: for one comment with len=509652, I was always getting a 500 error. stripping this comment by half works, though. this fixes it, i.e. no matter what the error is, if the value len is huge, we will first try to make it smaller --- issues.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/issues.py b/issues.py index 32a1729..364e2e5 100755 --- a/issues.py +++ b/issues.py @@ -54,8 +54,8 @@ def rest_call(before, after, data_dict=None): return __rest_call_unchecked(before, after, data_dict) except HTTPError, e: print "Got HTTPError:", e - if e.code == 413 and data_dict: # Request Entity Too Large - l = max(map(len, data_dict.itervalues())) + l = data_dict and max(map(len, data_dict.itervalues())) or 0 + if e.code == 413 or l >= 100000: # Request Entity Too Large assert l > 0 print "Longest value has len", l, "; now we are trying with half of that" l /= 2 -- cgit v1.2.1