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

New issue 2238 by movieext...@gmail.com: unicode error in postreview
http://code.google.com/p/reviewboard/issues/detail?id=2238

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

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
3.

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 postreview.py, 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 reviewboard-issues@googlegroups.com.
To unsubscribe from this group, send email to 
reviewboard-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/reviewboard-issues?hl=en.

Reply via email to