Properly prevent sending XML files opened in text mode
Sending XML files opened in text mode breaks the Content-Length
header sent by requests, making the server wait for more data until it times out or making it parse corrupted XML data. This is a common mistake when using body=open(path)
.