From 8a7c87eae5da07831437c54378eab4da6a41a992 Mon Sep 17 00:00:00 2001 From: David Trowbridge Date: Sat, 6 Feb 2010 11:29:08 -0800 Subject: post-review: correctly handle diff uploads, which contains non-ASCII characters Patch from Thilo-Alexander Ginkel. Previous post-review versions did not correctly generate the Content-Length header sent along with the api/json/reviewrequests//diff/new/ request as the header's value was calculated based upon the length of the request body in characters instead of bytes. This patch should fix that issue by using the UTF-8 encoding of the body for the length calculation. Reviewed at http://reviews.reviewboard.org/r/1298 --- rbtools/postreview.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rbtools/postreview.py b/rbtools/postreview.py index 39b29f8..eeb96ef 100755 --- a/rbtools/postreview.py +++ b/rbtools/postreview.py @@ -653,7 +653,7 @@ class ReviewBoardServer(object): content_type = "multipart/form-data; boundary=%s" % BOUNDARY - return content_type, content + return content_type, content.encode('utf-8') class SCMClient(object): -- cgit v1.2.3