summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Zeyer <albert.zeyer@rwth-aachen.de>2011-05-13 21:48:27 +0200
committerAlbert Zeyer <albert.zeyer@rwth-aachen.de>2011-05-13 21:48:27 +0200
commit193ec74260610929ece1a52fd2ba3924683fd773 (patch)
treee0a7c6256f8c8ff77c52f3d1ac1d61288e2efef1
parent7aad77dc6550d12f9935c7e34cc32689c1dd9ecd (diff)
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
-rwxr-xr-xissues.py4
1 files 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