JSON queue info characters \r\n can cause ValueError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python Jenkins |
New
|
Undecided
|
Unassigned |
Bug Description
Hello.
In some cases a call to get_queue_info() has caused a ValueError exception. This looks to be caused by the case where the Jenkins server that's been queried returns JSON literal with carriage return \r and newline \n. Here's the relevant part of the exception:
----------------
File "/opt/python2.
return json.loads(
File "/opt/python2.
return _default_
File "/opt/python2.
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/opt/python2.
obj, end = self.scan_once(s, idx)
ValueError: Invalid control character at: line 1 column 633 (char 633)
----------------
I've been able to get my specific error by changing this line in def get_queue_
return json.loads(
with these two lines:
queue = self.jenkins_
return json.loads(