use of locals() is picking up unencoded variables, breaking requests
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python Jenkins |
New
|
Undecided
|
Unassigned |
Bug Description
Jenkins uses a few unicode characters in places likes node labels. In our case, the labels exist in the function executing the request to get the node configuration, but the use of 'locals()' is picking that up and breaking on urllib:
File "/opt/mita/
File "/opt/mita/
File "/opt/mita/
url_path = format_spec % self._get_
File "/opt/mita/
params[k] = quote(v)
File "/usr/lib/
return ''.join(map(quoter, s))
KeyError: u'\u2018'
The commit that introduced this issue is: https:/
I would advise against the use of locals(), because it is tremendously easy to cause undesired side-effects that are hard to detect (it took us a while to understand where this character was coming from)
It looks like I got the commit sha1 wrong for the cause of the variable bleeding. I am not sure what commit introduced the usage of locals, but is for sure how we got into the decoding problem. We are fixing this on our end by sanitizing the variable before calling get_node_config