4574: No diffs added for gitlab changeset containing UTF8 BOM

mikaelpa-schneider

What version are you running?

2.5.6.1

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

-

What steps will reproduce the problem?

  1. Create a git repo in GitLab
  2. Add, commit and push a file which starts with a UTF8 BOM to the repo
  3. Set up the git repo in Review Board using a GitLab Hosting Account
  4. Create a Review Request from within Review Board and select the commit where the file was added.

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

Expected a Review Request with diff visible but there were no diff tab at all.

What operating system are you using? What browser?

Ubuntu, Google Chrome

Please provide any additional information below.

Attached is a file with UTF8 BOM with which I could reproduce the error.

The following stack trace was found in the server log:

2017-08-16 09:30:25,863 - ERROR - - Unable to update new review request from commit ID 35605884cda3d880e512d1cadb496be8d6610c7c: 'ascii' codec can't decode byte 0xef in position 141: ordinal not in range(128)
Traceback (most recent call last):
File "/home/mikael/schneider-work/gitflow/rb/reviewboard/reviewboard/reviews/managers.py", line 150, in create
review_request.update_from_commit_id(commit_id)
File "/home/mikael/schneider-work/gitflow/rb/reviewboard/reviewboard/reviews/models/base_review_request_details.py", line 221, in update_from_commit_id
self.update_from_committed_change(commit_id)
File "/home/mikael/schneider-work/gitflow/rb/reviewboard/reviewboard/reviews/models/base_review_request_details.py", line 278, in update_from_committed_change
diff_file_contents=commit.diff.encode('utf-8'),
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 141: ordinal not in range(128)

using System;
using System.Threading.Tasks;
using Windows.Storage;
david
#1 david

This was fixed in Review Board 2.5.10.

  • -New
    +Fixed