bpo-26730: Fix SpooledTemporaryFile data corruption (GH-17400)


SpooledTemporaryFile.rollback() might cause data corruption
when it is in text mode.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit ea9835c5d154ab6a54eed627958473b6768b28cc)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
4 files changed