fix refleak in the error case
Test the open of non-exitent tarfile in all modes.
Test the open of non-exitent tarfile in all modes.
#20206, #5803: more efficient algorithm that doesn't truncate output.

This fixes an edge case (20206) where if the input ended in a character
needing encoding but there was no newline on the string, the last byte
of the encoded character would be dropped.  The fix is to use a more
efficient algorithm, provided by Serhiy Storchaka (5803), that does not
have the bug.
Merge #20206, #5803: more efficient algorithm that doesn't truncate output.

(No idea why test_tarfile is listed as changed...it isn't.)
#20236: Fix sphinx markup.
Merge #20236: Fix sphinx markup.
Issue #20229: Avoid plistlib deprecation warning in platform.mac_ver().
Issue #20242: Fixed basicConfig() format strings for the alternative formatting styles.
Closes #20242: Merged fix from 3.3.
Correct a typo.  Found by Lauri Hakko on docs@.
Fix typo.
Merge typo fix.
complain when nbytes > buflen to fix possible buffer overflow (closes #20246)
merge 3.2 (#20246)
merge 3.3 (#20246)
merge 3.3 (#20246)
correct defaultdict signature in docstring (closes #20250)

Patch from Andrew Barnert.
merge 3.3 (#20250)
remove overly strict assertion (closes #20251)