3753: CRITICAL: <lambda>() keywords must be strings in RBTools 0.7.0
- Fixed
- Review Board
| bdq****@apc**** (Google Code) (Is this you? Claim this profile.) | |
|
|
|
| June 1, 2015 |
What version are you running? RBTools 0.7 What's the URL of the page containing the problem? rbt post What steps will reproduce the problem? rbt post What is the expected output? What do you see instead? rbt post What operating system are you using? What browser? Windows 7 Please provide any additional information below. I got the problem exactly the same with this issue https://code.google.com/p/reviewboard/issues/detail?id=3729 After following the suggestion , I fixed it but it raised another isssue, please see the attachment.
It's possible that this is fixed in 0.7.1 (please try) If not, please post the output of 'rbt post --debug'
-
+ NeedInfo -
+ Component-RBTools
I'm using RBTools 0.7.1 on FreeBSD and I see the following error:
# rbt post
Generating diff for pending changeset default
CRITICAL: <lambda>() keywords must be strings
Running with debug on:
# rbt post --debug
.
...
.....
>>> Making HTTP GET request to http://reviews.blah.com/api/review-requests/?only-links=create&only-fields=
Traceback (most recent call last):
File "/usr/local/bin/rbt", line 8, in <module>
load_entry_point('RBTools==0.7.1', 'console_scripts', 'rbt')()
File "/usr/local/lib/python2.6/site-packages/RBTools-0.7.1-py2.6.egg/rbtools/commands/main.py", line 133, in main
command.run_from_argv([RB_MAIN, command_name] + args)
File "/usr/local/lib/python2.6/site-packages/RBTools-0.7.1-py2.6.egg/rbtools/commands/__init__.py", line 538, in run_from_argv
exit_code = self.main(*args) or 0
File "/usr/local/lib/python2.6/site-packages/RBTools-0.7.1-py2.6.egg/rbtools/commands/post.py", line 717, in main
base_dir=base_dir)
File "/usr/local/lib/python2.6/site-packages/RBTools-0.7.1-py2.6.egg/rbtools/commands/post.py", line 402, in post_request
review_request = review_requests.create(**request_data)
TypeError: <lambda>() keywords must be strings
I think this is caused by https://github.com/reviewboard/rbtools/commit/8c8e4eb7a64be3da8df833608dc6b4f95ccc03e0 with python 2.6.
The problem is that lambda behavior has apparently changed between 2.6 and 2.7:
$ python2.7 -c "from __future__ import unicode_literals; x = lambda a='a', b='b': a+b; print x(**{'a':'c', 'b':'d'})"
cd
$ python2.6 -c "from __future__ import unicode_literals; x = lambda a='a', b='b': a+b; print x(**{'a':'c', 'b':'d'})"
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: <lambda>() keywords must be strings
Using python 2.7 fixes the problem. Not sure if rbtools is supposed to work with 2.6 but if it is, the problem is here:
https://github.com/reviewboard/rbtools/blob/release-0.7.2/rbtools/commands/post.py#L402
review_requests.create is a lambda, it is being fed unicode literals.