Issue #16884: updated logging documentation to include lastResort and use 'note' directives where appropriate.
Issue #16884: Merged logging documentation fixes from 3.2.
Issue #15972: Fix error messages when os functions expecting a file name or
file descriptor receive the incorrect type.
Issue #15845: Fix comparison between bytes and string.
Issue #15845: Fix comparison between bytes and string.
Issue #16884: Updated docs to use 'note' directives in a couple of places missed earlier.
Issue #16884: Merged doc fix from 3.2.