4627: Diff fragments do not load.

jhominal
chipx86
chipx86

What version are you running?

3.0.2

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

/reviews/r/:review_id/diff/:diff_id

What steps will reproduce the problem?

  1. Open a review diff page

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

None of the diff fragments load.

What operating system are you using? What browser?

The server's operating system is Python 2.7.5 shipped by Red Hat on RHEL 7. (Browser is Chrome on Windows)

Please provide any additional information below.

The Python exception is "TypeError: Struct() argument 1 must be string, not unicode".

I was able to fix the issue on my instance by patching all of reviews/views.py calls to struct.pack (lines 975, 977 and 1430) by using byte literals in the first argument instead of string literals (which are implied to be unicode).

chipx86
#1 chipx86

Turns out this is a Python compatibility issue. As of Python 2.7.7, Unicode strings are allowed. We'll get a patch out for the next release, but for now I'd go with your patch. I'll post our version of it here.

chipx86
#2 chipx86

Fix up for review: https://reviews.reviewboard.org/r/9476/

  • -New
    +PendingReview
  • +Release-3.0.x
  • -Priority:Medium
    +Component:Reviews
    +Priority:High
  • +chipx86
chipx86
#3 chipx86

Fix pushed to release-3.0.x (e6d11ca70537c820081ce0afe58268cd781fa452).

  • -PendingReview
    +Fixed