Fixed stream multipart encoding for python3