I was using requests wrong. This seems to fix it:
resp = requests.request('put', 'http://localhost:8000/wp-json/wp/v2/posts/8', json=data, auth=HTTPBasicAuth(userid, passwd))
I was using requests wrong. This seems to fix it:
resp = requests.request('put', 'http://localhost:8000/wp-json/wp/v2/posts/8', json=data, auth=HTTPBasicAuth(userid, passwd))