Comment #1 on issue 2616 by karsten....@gmail.com: post-review cannot post utf-8 in summary or description
http://code.google.com/p/reviewboard/issues/detail?id=2616

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'www.reviewboard.com' + "\x81" => error
The solution:
str(u'www.reviewboard.com') + "\x81" => 'www.reviewboard.com\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?

         try:
-            r = HTTPRequest(url, body, headers, method='PUT')
+            r = HTTPRequest(str(url), body, headers, method='PUT')
             data = urllib2.urlopen(r).read()
             self.cookie_jar.save(self.cookie_file)





--
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To post to this group, send email to reviewboard-issues@googlegroups.com.
To unsubscribe from this group, send email to 
reviewboard-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/reviewboard-issues?hl=en.

Reply via email to