summaryrefslogtreecommitdiff
path: root/Lib/runpy.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-07-04 01:47:40 +0200
committerVictor Stinner <victor.stinner@haypocalc.com>2011-07-04 01:47:40 +0200
commit7d8c8a095a19ea63a313c6b937bc2bbcbc7fd6f9 (patch)
tree42729a85f88e7b736db721787e3caa2ff855f4f3 /Lib/runpy.py
parent3663abab59a397c971fb7e039f5f91b171be12d8 (diff)
parent6c471029821677e893a203a0127777735ff526c7 (diff)
downloadcpython-git-7d8c8a095a19ea63a313c6b937bc2bbcbc7fd6f9.tar.gz
(merge 3.2) Issue #12451: runpy: run_path() now opens the Python script in
binary mode, instead of text mode using the locale encoding, to support other encodings than UTF-8 (scripts using the coding cookie).
Diffstat (limited to 'Lib/runpy.py')
-rw-r--r--Lib/runpy.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/runpy.py b/Lib/runpy.py
index 496df6d59b..31e5e55cfa 100644
--- a/Lib/runpy.py
+++ b/Lib/runpy.py
@@ -226,7 +226,7 @@ def _get_code_from_file(fname):
code = read_code(f)
if code is None:
# That didn't work, so try it as normal source code
- with open(fname, "r") as f:
+ with open(fname, "rb") as f:
code = compile(f.read(), fname, 'exec')
return code