Use a context manager to close immediatly the socket on error.
Attach a file by drag & drop or click to upload