What version are you running?
RBTools version 0.6.2 | ReviewBoard version 2.0.2
What's the URL of the page containing the problem?
/api/review-requests/{review_request_id}/diff-context/
What steps will reproduce the problem?
sample code:
1. from rbtools.api.client import RBClient
2. client = RBClient("http://localhost/reviewboard")
3. root = client.get_root()
4. rq = root.get_review_request(review_request_id=3)
5. context = rq.get_diff_context(revision=1, interdiff_revision=1)
What is the expected output? What do you see instead?
A context of review request
What operating system are you using? What browser?
Linux Debian Jessie / Windows 7
Please provide any additional information below.
Traceback:
---------------------------------------------------------------------------
BadRequestError Traceback (most recent call last)
<ipython-input-7-940e0d500129> in <module>()
----> 1 context = rq.get_diff_context(revision=1, interdiff_revision=1)
/DOWTMP/env/lib/python2.7/site-packages/RBTools-0.6.2-py2.7.egg/rbtools/api/resource.pyc in <lambda>(resource, url, **kwargs)
137 "get_%s" % link,
138 lambda resource=self, url=body['href'], **kwargs: (
--> 139 self._get_url(url, **kwargs)))
140
141 def _wrap_field(self, field):
/DOWTMP/env/lib/python2.7/site-packages/RBTools-0.6.2-py2.7.egg/rbtools/api/decorators.pyc in request_method(self, *args, **kwargs)
22
23 return self._transport.execute_request_method(method_wrapper,
---> 24 *args, **kwargs)
25
26 request_method.__name__ = f.__name__
/DOWTMP/env/lib/python2.7/site-packages/RBTools-0.6.2-py2.7.egg/rbtools/api/transport/sync.pyc in execute_request_method(self, method, *args, **kwargs)
59
60 if isinstance(request, HttpRequest):
---> 61 return self._execute_request(request)
62
63 return request
/DOWTMP/env/lib/python2.7/site-packages/RBTools-0.6.2-py2.7.egg/rbtools/api/transport/sync.pyc in _execute_request(self, request)
68 request.url))
69
---> 70 rsp = self.server.make_request(request)
71 info = rsp.info()
72 mime_type = info['Content-Type']
/DOWTMP/env/lib/python2.7/site-packages/RBTools-0.6.2-py2.7.egg/rbtools/api/request.pyc in make_request(self, request)
482 rsp = urllib2.urlopen(r)
483 except urllib2.HTTPError, e:
--> 484 self.process_error(e.code, e.read())
485 except urllib2.URLError, e:
486 raise ServerInterfaceError("%s" % e.reason)
/DOWTMP/env/lib/python2.7/site-packages/RBTools-0.6.2-py2.7.egg/rbtools/api/request.pyc in process_error(self, http_status, data)
455
456 raise create_api_error(http_status, rsp['err']['code'], rsp,
--> 457 rsp['err']['msg'])
458 except ValueError:
459 logging.debug('Got HTTP error: %s: %s' % (http_status, data))
BadRequestError: One or more fields had errors (HTTP 400, API Error 105)
interdiff-revision: Field is not supported
__________________________________________________________________________
This is problem with replacing all "_" by "-" where http url is created (api/request.py line 54)
Place where this argument is defined - reviewboard/webapi/resources/diff_context.py#L43
Best Regards,
Michal