Issue #24402: Merge input() fix from 3.4 into 3.5