Closed Bug 1096964 Opened 10 years ago Closed 10 years ago

[rbbz] Plain Text review rendering fails when unicode is present in the review

Categories

(MozReview Graveyard :: General, defect, P1)

Development/Staging
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: smacleod, Unassigned, Mentored)

Details

Attachments

(2 files, 1 obsolete file)

If a review contains unicode we will fail to publish it due to a bug in our plaintext rendering code.

https://hg.mozilla.org/hgcustom/version-control-tools/file/a7462aae407b/pylib/rbbz/rbbz/diffs.py#l292

File "/data/www/reviewboard.mozilla.org/venv/lib/python2.6/site-packages/rbbz/extension.py", line 349, in on_review_publishing
    {"user": user})
  File "/data/www/reviewboard.mozilla.org/venv/lib/python2.6/site-packages/rbbz/diffs.py", line 304, in build_plaintext_review
    review.is_reply()))
  File "/data/www/reviewboard.mozilla.org/venv/lib/python2.6/site-packages/rbbz/diffs.py", line 292, in render_comment_plain
    return "\n".join(lines)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 100: ordinal not in range(128)
The sample that triggered this bug was:

“This will always return an empty array now.  It returned undefined when getVisibleCookies had a try…catch for importing the cookie manager.”

Removing the … character published the review successfully.
Attached file MozReview Request: bz://1096964/gps (obsolete) —
Attachment #8533460 - Flags: review?(smacleod)
/r/1343 - reviewboard: create commands for interacting with reviews
/r/1345 - rbbz: handle unicode in review comments (bug 1096964)

Pull down these commits:

hg pull review -r b2c7ba42fa915db15cbe20284a516538f256f5a4
Attachment #8533460 - Flags: review?(smacleod) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Attachment #8533460 - Attachment is obsolete: true
Attachment #8618593 - Flags: review+
Attachment #8618594 - Flags: review+
Product: Developer Services → MozReview
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: