Labels: Type-Defect Priority-Medium
New issue 2238 by movieext...@gmail.com: unicode error in postreview
* 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?
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?
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
To post to this group, send email to email@example.com.
To unsubscribe from this group, send email to
For more options, visit this group at