Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 2238 by unicode error in postreview

* NOTE: Do not post confidential information in this bug report. *
*       If you need immediate support, please contact            *
*                             *

What version are you running?

1.6 RC2

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

This is the postreview

What steps will reproduce the problem?
1. post_review --summary="xxx" -o --revision-range=....
2. the diff contains non-ascii characters

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

Unicode error

What operating system are you using? What browser?

Linux / Ubuntu

Please provide any additional information below.

The error is in, line 894. If the url is passed in as unicode, urlopen will convert data (which is encoded utf8) to unicode. This causes a conversion error.

The solution is to encode the url to a string before calling urlopen.

            if type(url) == unicode:                   # new code
                url = url.encode('utf8')               # new code
            r = urllib2.Request(url, body, headers)    # existing
            data = urllib2.urlopen(r).read()           # existing

You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to