3518: Can't upload review due to UnicodeDecodeError

e.apol******@gmai***** (Google Code) (Is this you? Claim this profile.)
david
david
Aug. 5, 2014
What version are you running?
2.0.5
Same issue on 2.0.4

What's the URL of the page containing the problem?
http://vssd-rb.digdes.com/r/new/

What steps will reproduce the problem?
1.Create review request using 'New Review Request for Pending Change' form.
2.Review request isn't created. Placeholder runs forever.

Same issue while uploading request using rbt post.

What is the expected output? What do you see instead?


What operating system are you using? What browser?
Ubuntu 14.04.1 LTS
Same issue on 13.10 and 13.04

Please provide any additional information below.

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.8-py2.7.egg/djblets/webapi/resources.py", line 494, in __call__
    request, method, view, api_format=api_format, *args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.8.8-py2.7.egg/djblets/webapi/resources.py", line 565, in call_method_view
    return view(request, *args, **kwargs)

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

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

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.5-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.8-py2.7.egg/djblets/webapi/decorators.py", line 117, in _call
    return view_func(*args, **kwargs)

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

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

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

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

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.5-py2.7.egg/reviewboard/webapi/resources/validate_diff.py", line 135, in create
    save=False)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.5-py2.7.egg/reviewboard/diffviewer/managers.py", line 156, in create_from_upload
    save=save)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.5-py2.7.egg/reviewboard/diffviewer/managers.py", line 182, in create_from_data
    check_existence=(not parent_diff_file_contents)))

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.5-py2.7.egg/reviewboard/diffviewer/managers.py", line 300, in _process_files
    request=request))):

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.5-py2.7.egg/reviewboard/scmtools/models.py", line 271, in get_file_exists
    base_commit_id, request)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.5-py2.7.egg/reviewboard/scmtools/models.py", line 466, in _get_file_exists_uncached
    exists = self.get_scmtool().file_exists(path, revision)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.5-py2.7.egg/reviewboard/scmtools/core.py", line 156, in file_exists
    self.get_file(path, revision)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.5-py2.7.egg/reviewboard/scmtools/svn/__init__.py", line 117, in get_file
    return self.client.get_file(path, revision)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.5-py2.7.egg/reviewboard/scmtools/svn/pysvn.py", line 106, in get_file
    return self._do_on_path(self._get_file_data, path, revision)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-2.0.5-py2.7.egg/reviewboard/scmtools/svn/pysvn.py", line 75, in _do_on_path
    stre = six.text_type(e)

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


<WSGIRequest
path:/api/validation/diffs/,
GET:<QueryDict: {}>,
POST:<QueryDict: {u'basedir': [u'svn.digdes.com/Projects/AvroRAID/Userspace/branches/4.2_remote_target12'], u'repository': [u'8']}>,
COOKIES:{'collapsediffs': 'False',
 'csrftoken': 'gjNL6vYns2cd3HWgvrHCF6k9F21w7nhb',
 'rbsessionid': '7mb87848j2kaehzfq9fgddsuxcqi7sux',
 'show_ew': 'false'},
META:{'CONTENT_LENGTH': '23453',
 'CONTENT_TYPE': 'multipart/form-data; boundary=-----multipartformboundary1407159097003',
 'DOCUMENT_ROOT': '/var/www/vssd-rb.digdes.com/htdocs',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': 'application/json, text/javascript, */*; q=0.01',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.5',
 'HTTP_CACHE_CONTROL': 'no-cache',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_CONTENT_LENGTH': '23453',
 'HTTP_COOKIE': 'rbsessionid=7mb87848j2kaehzfq9fgddsuxcqi7sux; csrftoken=gjNL6vYns2cd3HWgvrHCF6k9F21w7nhb; collapsediffs=False; show_ew=false',
 'HTTP_HOST': 'vssd-rb.digdes.com',
 'HTTP_PRAGMA': 'no-cache',
 'HTTP_REFERER': 'http://vssd-rb.digdes.com/r/new/',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:28.0) Gecko/20100101 Firefox/28.0',
 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
 'PATH_INFO': u'/api/validation/diffs/',
 'PATH_TRANSLATED': '/var/www/vssd-rb.digdes.com/htdocs/api/validation/diffs/',
 'QUERY_STRING': '',
 'REDIRECT_STATUS': '200',
 'REDIRECT_URI': '/reviewboard.fcgi/api/validation/diffs/',
 'REMOTE_ADDR': '172.16.20.67',
 'REMOTE_PORT': '44645',
 'REQUEST_METHOD': 'POST',
 'REQUEST_URI': '/api/validation/diffs/',
 'SCRIPT_FILENAME': '/var/www/vssd-rb.digdes.com/htdocs/reviewboard.fcgi',
 'SCRIPT_NAME': u'',
 'SERVER_ADDR': '192.168.58.20',
 'SERVER_NAME': 'vssd-rb.digdes.com',
 'SERVER_PORT': '80',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'lighttpd/1.4.33',
 'wsgi.errors': <flup.server.fcgi_base.OutputStream object at 0x7f662b581fd0>,
 'wsgi.input': <flup.server.fcgi_base.InputStream object at 0x7f662b5810d0>,
 'wsgi.multiprocess': False,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}>
#1 ale****@gmai***** (Google Code) (Is this you? Claim this profile.)
I confirm this issue. It is reproduced on Windows OSes too.
The bug is regression against the previous major release version 1.7.x
The bug occurs when a file in SVN contains any non-ASCII symbol and diff uploads against such file. At the same time, diff with non-ASCII symbols can be uploaded.

mysql settings:
mysql> SHOW VARIABLES WHERE variable_name IN ('character_set_database', 'collation_database');
+------------------------+-----------------+
| Variable_name          | Value           |
+------------------------+-----------------+
| character_set_database | utf8            |
| collation_database     | utf8_unicode_ci |
+------------------------+-----------------+
2 rows in set (0.00 sec)
david
#2 david
  • +PendingReview
  • +Component-SCMTools
    +Project-ReviewBoard
  • +david
david
#3 david
Fixed in release-2.0.x (6c7881f). Thanks!
  • -PendingReview
    +Fixed