Issue #25764: Merge subprocess fix from 3.5