python client publish to handle 5XX; continue to publish until successful