Issue #23972: Fix tests for Windows and Debian. (Merge 3.5->3.6)