bpo-33751: Fix test_file. (GH-7378)


testModeStrings and testTruncateOnWindows were depended on
a file leaked in other tests.

Also improve cleaning up after tests.
(cherry picked from commit c2745d2d05546d76f655ab450eb23d1af39e0b1c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 file changed