Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 2616 by post-review cannot post utf-8 in summary or description

* NOTE: Do not post confidential information in this bug report. *
*       If you need immediate support, please contact            *
*                             *

What version are you running?
RBTools VERSION = (0, 3, 4, 'final', 0, True)

What's the URL of the page containing the problem?
post-review --guess-summary --guess-description

What steps will reproduce the problem?
1. post-review --summary ሴ🐳

What is the expected output? What do you see instead?
Expected output: success
seen output: Traceback (most recent call last):
  File "/usr/bin/post-review", line 9, in <module>
    load_entry_point('RBTools==0.3.4', 'console_scripts', 'post-review')()
File "/usr/lib/python2.7/dist-packages/rbtools/", line 4029, in main
File "/usr/lib/python2.7/dist-packages/rbtools/", line 3628, in tempt_fate
File "/usr/lib/python2.7/dist-packages/rbtools/", line 759, in set_review_request_field
    field: value,
File "/usr/lib/python2.7/dist-packages/rbtools/", line 1081, in api_put
    return self.process_json(self.http_put(path, fields))
File "/usr/lib/python2.7/dist-packages/rbtools/", line 1027, in http_put
    data = urllib2.urlopen(r).read()
  File "/usr/lib/python2.7/", line 126, in urlopen
    return, data, timeout)
  File "/usr/lib/python2.7/", line 400, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/", line 418, in _open
    '_open', req)
  File "/usr/lib/python2.7/", line 378, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/", line 1215, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/lib/python2.7/", line 1174, in do_open
    h.request(req.get_method(), req.get_selector(),, headers)
  File "/usr/lib/python2.7/", line 958, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/", line 992, in _send_request
  File "/usr/lib/python2.7/", line 954, in endheaders
  File "/usr/lib/python2.7/", line 812, in _send_output
    msg += message_body
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 91: ordinal not in range(128)

What operating system are you using? What browser?
Ubuntu Linux 12.04

Please provide any additional information below.
A possible patch is to add the following lines to def http_put():

+            if isinstance(url, unicode):
+                url = url.encode('utf-8')
+            if isinstance(body, unicode):
+                body = body.encode('utf-8')
             r = HTTPRequest(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