> Thanks for the fixes:
>
> 161 # The request in this case needs to be a GET.
> 162 json_string =
> sanitize_json_response(urllib2.urlopen(request).read())
> 163 return json_string
> It is probably good to initialize json_string in gerrit.py to None here
> before we called sanitize_json_response.
Sure, fixed.
> 175 def sanitize_json_response(json_string):
> 176 """Cleans up the JSON response got from the REST interface, in order
> to be
> 177 valid JSON.
> 178
> 179 :param json_string: the JSON string to clean up.
> 180 """
> 181 # The JSON response is not valid JSON, there is a magic sequence at
> the
> 182 # beginning of the result. We are paranoid, and remove also other
> white
> 183 # spaces.
> 184 if json_string.startswith(GERRIT_SANITIZABLE_VALUE):
> 185 return json_string.lstrip(GERRIT_SANITIZABLE_VALUE).strip()
>
> Are we sure we that the json_string should always start with
> GERRIT_SANITIZABLE_VALUE ??
> If not, then we need to return json_string even when json_string does not
> start with GERRIT_SANITIZABLE_VALUE.
> Thanks for the fixes: json_response( urllib2. urlopen( request) .read() ) json_response.
>
> 161 # The request in this case needs to be a GET.
> 162 json_string =
> sanitize_
> 163 return json_string
> It is probably good to initialize json_string in gerrit.py to None here
> before we called sanitize_
Sure, fixed.
> 175 def sanitize_ json_response( json_string) : startswith( GERRIT_ SANITIZABLE_ VALUE): lstrip( GERRIT_ SANITIZABLE_ VALUE). strip() SANITIZABLE_ VALUE ?? SANITIZABLE_ VALUE.
> 176 """Cleans up the JSON response got from the REST interface, in order
> to be
> 177 valid JSON.
> 178
> 179 :param json_string: the JSON string to clean up.
> 180 """
> 181 # The JSON response is not valid JSON, there is a magic sequence at
> the
> 182 # beginning of the result. We are paranoid, and remove also other
> white
> 183 # spaces.
> 184 if json_string.
> 185 return json_string.
>
> Are we sure we that the json_string should always start with
> GERRIT_
> If not, then we need to return json_string even when json_string does not
> start with GERRIT_
As for Gerrit documentation, it should be. Link where it is written is here: /gerrit- review. googlesource. com/Documentati on/rest- api.html
https:/
But better handle that case too.
Thanks.