summaryrefslogtreecommitdiff
path: root/Lib/runpy.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-07-04 01:45:39 +0200
committerVictor Stinner <victor.stinner@haypocalc.com>2011-07-04 01:45:39 +0200
commit6c471029821677e893a203a0127777735ff526c7 (patch)
tree2df9ccc41397a020f74b3677d49574d6dbec070d /Lib/runpy.py
parentbbdc08ea6e5d3f2d9058991a65b6011dfbb8d233 (diff)
downloadcpython-git-6c471029821677e893a203a0127777735ff526c7.tar.gz
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 4738df307a..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, "rU") as f:
+ with open(fname, "rb") as f:
code = compile(f.read(), fname, 'exec')
return code