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

New issue 2155 by jerb...@gmail.com: post-review fails to upload diff if non-ascii characters are used in diff
http://code.google.com/p/reviewboard/issues/detail?id=2155

What version are you running?
RBTools v0.3.2

What steps will reproduce the problem?
1. use post-review to upload the attached patch for a review (note it works in the browser)

Also, I'm aware that this seems to be a problem in Python 2.7's urllib.py (perhaps an Ubuntu only problem, I don't know).

What is the expected output? What do you see instead?
Expected: Patch gets uploaded without a problem using post-review. Actual: See stack trace below.

What operating system are you using? What browser?
I'm on Ubuntu 11.04, Firefox (totally unrelated for this problem)

Here is an example stack trace:
HTTP POSTing to http://review.markusproject.org/api/review-requests/1048/diffs/: {}
Traceback (most recent call last):
  File "/usr/local/bin/post-review", line 9, in <module>
    load_entry_point('RBTools==0.3.2', 'console_scripts', 'post-review')()
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.3.2-py2.7.egg/rbtools/postreview.py", line 3794, in main
    submit_as=options.submit_as)
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.3.2-py2.7.egg/rbtools/postreview.py", line 3460, in tempt_fate
    parent_diff_content)
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.3.2-py2.7.egg/rbtools/postreview.py", line 769, in upload_diff
    fields, files)
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.3.2-py2.7.egg/rbtools/postreview.py", line 982, in api_post
    return self.process_json(self.http_post(path, fields, files))
File "/usr/local/lib/python2.7/dist-packages/RBTools-0.3.2-py2.7.egg/rbtools/postreview.py", line 903, in http_post
    data = urllib2.urlopen(r).read()
  File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 391, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 409, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1185, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1154, in do_open
    h.request(req.get_method(), req.get_selector(), req.data, headers)
  File "/usr/lib/python2.7/httplib.py", line 955, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 989, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 951, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 809, in _send_output
    msg += message_body
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 14060: ordinal not in range(128)

Not sure if that will be helpful:

$ locale
LANG=en_CA.UTF-8
LANGUAGE=en_CA:en
LC_CTYPE="en_CA.UTF-8"
LC_NUMERIC="en_CA.UTF-8"
LC_TIME="en_CA.UTF-8"
LC_COLLATE="en_CA.UTF-8"
LC_MONETARY="en_CA.UTF-8"
LC_MESSAGES="en_CA.UTF-8"
LC_PAPER="en_CA.UTF-8"
LC_NAME="en_CA.UTF-8"
LC_ADDRESS="en_CA.UTF-8"
LC_TELEPHONE="en_CA.UTF-8"
LC_MEASUREMENT="en_CA.UTF-8"
LC_IDENTIFICATION="en_CA.UTF-8"
LC_ALL=

Attachments:
        sub_tabs.diff  15.8 KB

--
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