bpo-34500: Fix ResourceWarning in difflib.py (GH-8926)

The change to Tools/scripts/diff.py effectively backports part of
a2637729f23dc993e820fd92f0d1759ad714c9b2.
The test code changed in Doc/library/difflib.rst is not present in current 3.x.
3 files changed