3407: Perforce review fails with UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 20: ordinal not in range(128)

labo****@gmai***** (Google Code) (Is this you? Claim this profile.)
david
david
June 8, 2014
What version are you running?
2.0

What's the URL of the page containing the problem?
/reviews

What steps will reproduce the problem?
1. Posting a review with a perforce depot
2.
3.

What is the expected output? What do you see instead?
Here's the error backtrace:

Traceback (most recent call last):

  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.5-py2.7.egg/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.5-py2.7.egg/django/views/decorators/cache.py", line 52, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Django-1.6.5-py2.7.egg/django/views/decorators/vary.py", line 19, in inner_func
    response = func(*args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8-py2.7.egg/djblets/webapi/resources.py", line 451, in __call__
    result = view(request, api_format=api_format, *args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8-py2.7.egg/djblets/webapi/resources.py", line 672, in post
    return self.create(*args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8-py2.7.egg/djblets/webapi/decorators.py", line 115, in _call
    return view_func(*args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0-py2.7.egg/reviewboard/webapi/decorators.py", line 110, in _check
    return view_func(*args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8-py2.7.egg/djblets/webapi/decorators.py", line 115, in _call
    return view_func(*args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8-py2.7.egg/djblets/webapi/decorators.py", line 136, in _checklogin
    return view_func(*args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8-py2.7.egg/djblets/webapi/decorators.py", line 115, in _call
    return view_func(*args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8-py2.7.egg/djblets/webapi/decorators.py", line 115, in _call
    return view_func(*args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8-py2.7.egg/djblets/webapi/decorators.py", line 285, in _validate
    return view_func(*args, **new_kwargs)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0-py2.7.egg/reviewboard/webapi/resources/review_request.py", line 561, in create
    create_from_commit_id=create_from_commit_id)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0-py2.7.egg/reviewboard/reviews/managers.py", line 135, in create
    review_request.update_from_commit_id(commit_id)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0-py2.7.egg/reviewboard/reviews/models/base_review_request_details.py", line 181, in update_from_commit_id
    changeset = scmtool.get_changeset(commit_id, allow_empty=True)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0-py2.7.egg/reviewboard/scmtools/perforce.py", line 330, in get_changeset
    allow_empty)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0-py2.7.egg/reviewboard/scmtools/perforce.py", line 391, in parse_change_desc
    split = changeset.description.find('\n\n')

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 20: ordinal not in range(128)


<WSGIRequest
path:/reviews/api/review-requests/,
GET:<QueryDict: {}>,
POST:<QueryDict: {u'changenum': [u'276353'], u'repository': [u'devsrc-2666']}>,
COOKIES:{'rbsessionid': 'x6goqyige4r9po0dg0al15jgsobv47c4'},
META:{'CONTENT_LENGTH': '265',
 'CONTENT_TYPE': 'multipart/form-data; boundary=10.252.243.193.502.93799.1402046892.425.1',
 'DOCUMENT_ROOT': '/var/www/mobile.reviews/htdocs',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT_ENCODING': 'identity',
 'HTTP_CONNECTION': 'close',
 'HTTP_COOKIE': 'rbsessionid=x6goqyige4r9po0dg0al15jgsobv47c4',
 'HTTP_HOST': 'mobile-dev.eng.citrite.net',
 'HTTP_USER_AGENT': 'RBTools/0.4.2',
 'PATH_INFO': u'/reviews/api/review-requests/',
 'PATH_TRANSLATED': '/var/www/mobile.reviews/htdocs/reviewboard.wsgi/reviews/api/review-requests/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '10.252.243.193',
 'REMOTE_PORT': '55005',
 'REQUEST_METHOD': 'POST',
 'REQUEST_URI': '/reviews/api/review-requests/',
 'SCRIPT_FILENAME': '/var/www/mobile.reviews/htdocs/reviewboard.wsgi',
 'SCRIPT_NAME': u'',
 'SERVER_ADDR': '10.105.64.28',
 'SERVER_ADMIN': '[no address given]',
 'SERVER_NAME': 'mobile-dev.eng.citrite.net',
 'SERVER_PORT': '80',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SIGNATURE': '<address>Apache/2.2.22 (Ubuntu) Server at mobile-dev.eng.citrite.net Port 80</address>\n',
 'SERVER_SOFTWARE': 'Apache/2.2.22 (Ubuntu)',
 'mod_wsgi.application_group': 'mobile-dev.eng.citrite.net|',
 'mod_wsgi.callable_object': 'application',
 'mod_wsgi.handler_script': '',
 'mod_wsgi.input_chunked': '0',
 'mod_wsgi.listener_host': '',
 'mod_wsgi.listener_port': '80',
 'mod_wsgi.process_group': '',
 'mod_wsgi.request_handler': 'wsgi-script',
 'mod_wsgi.script_reloading': '1',
 'mod_wsgi.version': (3, 3),
 'wsgi.errors': <mod_wsgi.Log object at 0x7fc5117ab2b0>,
 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7fc4bc0555d0>,
 'wsgi.input': <mod_wsgi.Input object at 0x7fc5117ab9f0>,
 'wsgi.multiprocess': True,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 1)}>


What operating system are you using? What browser?
ubuntu / firefox

Please provide any additional information below.
Seems to occur on random review requests.
#1 labo****@gmai***** (Google Code) (Is this you? Claim this profile.)
Further on this - it turns out that having a quote " character in the change request was causing this.
david
#2 david
  • +PendingReview
  • +Component-SCMTools
  • +david
david
#3 david
Fixed in release-2.0.x (5408b54). Thanks!
  • -PendingReview
    +Fixed