Python call to V4 Api parse error on calling member data

We’ve not made any code changes but notice since the 15th July, we’ve been getting a parse error :

{'errors': [{'message': 'Parse error on ")" (RPAREN) at [1, 66]', 'locations': [{'line': 1, 'column': 66}]}]}

The code we’re executing is (login removed):

endcursor = ""
while endcursor != '\"None\"':
    query = "query {{ organization(login:xxxx) {{ membersWithRole(first:100 after:{}) {{ totalCount edges {{ node {{ id login isSiteAdmin }}}} pageInfo {{ endCursor }}}}}} rateLimit{{ cost remaining }}}}".format(endcursor)
    r =,json={'query': query},headers=GITHUB_V4_HEADERS)
    rawdata = r.json()
    print (rawdata)
    data = rawdata["data"]
    endcursor = '\"{}\"'.format(data["organization"]["membersWithRole"]["pageInfo"]["endCursor"])

Has anyone experienced this recently ?

I cannot see any changes to the v4 on the 14th / 15th that could cause this.

Hi @humaya01,

Thank you for being here and apologies for the delay in response, are you still experiencing this issue?

Hi @andreagriffiths11 ,

Thanks for the warm welcome. We are indeed seeing the issues.

Same error here…