bpo-20844: open script file with "rb" mode (GH-12616)

(cherry picked from commit 10654c19b5e6efdf3c529ff9bf7bcab89bdca1c1)
4 files changed