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

New issue 1689 by tstoakes: post-review --guess-summary should trim internal newlines

*NOTE: Do not post confidential information in this bug report.*

What version are you running?
post-review --version: RBTools 0.2
Reviewboard server:
git --version:

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

What steps will reproduce the problem?
1. Create a git branch from a git-svn base
2. Make >=2 new git commits on this git branch, where each commit log is of the form:
First line\n
<blank line>\n
second line...
3. post-review --revision-range=HEAD^^:HEAD --guess-summary ...

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

The --guess-summary option takes the first line from each (2) commit message, and concatenates. However, the newlines are not being stripped. This results in django errors being emailed to the administrator when the review is posted (and an error in the web browser).

Traceback (most recent call last):

File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/core/handlers/",
line 92, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/views/decorators/",
line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)

File "/usr/local/lib/python2.6/dist-packages/Djblets-0.5.5-py2.6.egg/djblets/webapi/",
line 59, in _checklogin
    response = view_func(request, *args, **kwargs)

File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-",
line 520, in review_request_publish

File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-",
line 458, in publish
    mail_review_request(user, self, changes)

File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-",
line 184, in mail_review_request

File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-",
line 114, in send_review_mail

File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/core/",
line 266, in send
    return self.get_connection(fail_silently).send_messages([self])

File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/core/",
line 172, in send_messages
    sent = self._send(message)

File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/core/",
line 186, in _send

File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-",
line 41, in message
    msg = super(SpiffyEmailMessage, self).message()

File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/core/",
line 238, in message
    msg['Subject'] = self.subject

File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/core/",
line 96, in __setitem__
    name, val = forbid_multi_line_headers(name, val)

File "/usr/local/lib/python2.6/dist-packages/Django-1.1.1-py2.6.egg/django/core/",
line 76, in forbid_multi_line_headers
    raise BadHeaderError("Header values can't contain newlines (got %r
for header %r)" % (val, name))

BadHeaderError: Header values can't contain newlines (got u'Review
Request: First line commit 1\nFirst line commit 2' for
header 'Subject')

What operating system are you using? What browser?
Linux (ubuntu) client and server. Firefox, not that it matters.

Please provide any additional information below.

GET:<QueryDict: {}>,
POST:<QueryDict: {u'dummy': [u'']}>,
COOKIES:{'collapsediffs': 'True', 'rbsessionid':
 'CONTENT_TYPE': 'application/x-www-form-urlencoded; charset=UTF-8',
 'HTTP_ACCEPT': 'application/json, text/javascript, */*',
 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
 'HTTP_ACCEPT_ENCODING': 'gzip,deflate',
 'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5',
 'HTTP_CACHE_CONTROL': 'no-cache',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_CONTENT_TYPE': 'application/x-www-form-urlencoded; charset=UTF-8',
 'HTTP_COOKIE': 'rbsessionid=acceb746e620d983a1c03a08322cbcff;
 'HTTP_KEEP_ALIVE': '300',
 'HTTP_PRAGMA': 'no-cache',
 'HTTP_REFERER': 'http://XXX/r/267/diff/?page=3',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux x86_64; en-US;
rv: Gecko/20100402 Ubuntu/9.10 (karmic) Firefox/3.5.9',
 'PATH_INFO': u'/api/json/reviewrequests/267/publish/',
 'REMOTE_ADDR': 'xxx',
 'SERVER_NAME': 'xxx',
 'SERVER_SOFTWARE': 'mod_python'}>

Re-pressing the publish button seems to make it work, but emails are not sent.

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