Comment #1 on issue 2616 by post-review cannot post utf-8 in summary or description

Actually body does not need to be converted.
The problem is that body is a <type 'str'>
url is of <type 'unicode>
Somewhere in the urllib2 package something happens like: url + body
To do unicode + str, the str is converted to unicode. However bytes >128 cannot be represented in unicode, hence the exception.
eg: u'' + "\x81" => error
The solution:
str(u'') + "\x81" => '\x81'

It seems the str() patch is already in place for the http_post function, but not for http_put.
So can you please update http_put similar to http_post?

-            r = HTTPRequest(url, body, headers, method='PUT')
+            r = HTTPRequest(str(url), body, headers, method='PUT')
             data = urllib2.urlopen(r).read()

You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to