Issue 2616 in reviewboard: post-review cannot post utf-8 in summary or description

2012-05-31 Thread reviewboard

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

New issue 2616 by karsten@gmail.com: post-review cannot post utf-8 in  
summary or description

http://code.google.com/p/reviewboard/issues/detail?id=2616

* 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?
RBTools VERSION = (0, 3, 4, 'final', 0, True)

What's the URL of the page containing the problem?
post-review --guess-summary --guess-description


What steps will reproduce the problem?
1. post-review --summary ሴ

What is the expected output? What do you see instead?
Expected output: success
seen output: Traceback (most recent call last):
  File /usr/bin/post-review, line 9, in module
load_entry_point('RBTools==0.3.4', 'console_scripts', 'post-review')()
  File /usr/lib/python2.7/dist-packages/rbtools/postreview.py, line 4029,  
in main

submit_as=options.submit_as)
  File /usr/lib/python2.7/dist-packages/rbtools/postreview.py, line 3628,  
in tempt_fate

options.summary)
  File /usr/lib/python2.7/dist-packages/rbtools/postreview.py, line 759,  
in set_review_request_field

field: value,
  File /usr/lib/python2.7/dist-packages/rbtools/postreview.py, line 1081,  
in api_put

return self.process_json(self.http_put(path, fields))
  File /usr/lib/python2.7/dist-packages/rbtools/postreview.py, line 1027,  
in http_put

data = urllib2.urlopen(r).read()
  File /usr/lib/python2.7/urllib2.py, line 126, in urlopen
return _opener.open(url, data, timeout)
  File /usr/lib/python2.7/urllib2.py, line 400, in open
response = self._open(req, data)
  File /usr/lib/python2.7/urllib2.py, line 418, in _open
'_open', req)
  File /usr/lib/python2.7/urllib2.py, line 378, in _call_chain
result = func(*args)
  File /usr/lib/python2.7/urllib2.py, line 1215, in https_open
return self.do_open(httplib.HTTPSConnection, req)
  File /usr/lib/python2.7/urllib2.py, line 1174, in do_open
h.request(req.get_method(), req.get_selector(), req.data, headers)
  File /usr/lib/python2.7/httplib.py, line 958, in request
self._send_request(method, url, body, headers)
  File /usr/lib/python2.7/httplib.py, line 992, in _send_request
self.endheaders(body)
  File /usr/lib/python2.7/httplib.py, line 954, in endheaders
self._send_output(message_body)
  File /usr/lib/python2.7/httplib.py, line 812, in _send_output
msg += message_body
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 91:  
ordinal not in range(128)



What operating system are you using? What browser?
Ubuntu Linux 12.04

Please provide any additional information below.
A possible patch is to add the following lines to def http_put():

 try:
+if isinstance(url, unicode):
+url = url.encode('utf-8')
+if isinstance(body, unicode):
+body = body.encode('utf-8')
 r = HTTPRequest(url, body, headers, method='PUT')
 data = urllib2.urlopen(r).read()
 self.cookie_jar.save(self.cookie_file)




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



Re: Issue 2616 in reviewboard: post-review cannot post utf-8 in summary or description

2012-05-31 Thread reviewboard


Comment #1 on issue 2616 by karsten@gmail.com: post-review cannot post  
utf-8 in summary or description

http://code.google.com/p/reviewboard/issues/detail?id=2616

Actually body does not need to be converted.
The problem is that body is a type 'str'
url is of type 'unicode
Somewhere in the urllib2 package something happens like: url + body
To do unicode + str, the str is converted to unicode. However bytes 128  
cannot be represented in unicode, hence the exception.

eg: u'www.reviewboard.com' + \x81 = error
The solution:
str(u'www.reviewboard.com') + \x81 = 'www.reviewboard.com\x81'


It seems the str() patch is already in place for the http_post function,  
but not for http_put.

So can you please update http_put similar to http_post?

 try:
-r = HTTPRequest(url, body, headers, method='PUT')
+r = HTTPRequest(str(url), body, headers, method='PUT')
 data = urllib2.urlopen(r).read()
 self.cookie_jar.save(self.cookie_file)





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



Re: Issue 2616 in reviewboard: post-review cannot post utf-8 in summary or description

2012-05-31 Thread reviewboard


Comment #2 on issue 2616 by karsten@gmail.com: post-review cannot post  
utf-8 in summary or description

http://code.google.com/p/reviewboard/issues/detail?id=2616

Patch submitted as review 3133 (http://reviews.reviewboard.org/r/3133/)

Attachments:
ttt  542 bytes

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



Re: Issue 2616 in reviewboard: post-review cannot post utf-8 in summary or description

2012-05-31 Thread reviewboard


Comment #3 on issue 2616 by karsten@gmail.com: post-review cannot post  
utf-8 in summary or description

http://code.google.com/p/reviewboard/issues/detail?id=2616

Patch submitted as review 3133 (http://reviews.reviewboard.org/r/3133/)

Attachments:
patch  542 bytes

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



Issue 2617 in reviewboard: Broken link to user page in review page auto update feature

2012-05-31 Thread reviewboard

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

New issue 2617 by andrewsa...@gmail.com: Broken link to user page in review  
page auto update feature

http://code.google.com/p/reviewboard/issues/detail?id=2617

* 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.4.1

What's the URL of the page containing the problem?
/reviewboard/r/XXX

What steps will reproduce the problem?
1. Go to a review
2. Update the review in another window (add a comment)
3. In the original window, the notification box pops up at the bottom of  
the page saying New reply by John Doe   Update page | Ignore

4. Click on 'John Doe'

What is the expected output? What do you see instead?
Expect to be taken to the user page for John Doe. Instead, get taken to 404  
error page. The href for the John Doe link is '/users/jdoe' when it should  
be '/reviewboard/users/jdoe'


What operating system are you using? What browser?
Windows XP, Chrome

Please provide any additional information below.


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



Re: Issue 2359 in reviewboard: Review creation fails with patches created with Subversion 1.7.x if they include a property change.

2012-05-31 Thread reviewboard


Comment #20 on issue 2359 by ben.mar...@gmail.com: Review creation fails  
with patches created with Subversion 1.7.x if they include a property  
change.

http://code.google.com/p/reviewboard/issues/detail?id=2359

My development team uses 'feature branches' so almost every time we  
generate a diff for review it contains svn:mergeinfo property changes.  We  
have to manually strip these out of the diff and it makes the post-review  
tool unusable.  This is probably the biggest usability issue that we have.  
I recommend making this issue a high priority.


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