From 0aff1226b277c7cce16c70ab39d1409814d35a64 Mon Sep 17 00:00:00 2001 From: Robert Kern Date: Wed, 4 Nov 2015 20:27:51 +0000 Subject: [PATCH] BUG: Read source files as bytes. --- README.rst | 4 ++++ kernprof.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index bc99414..3474267 100644 --- a/README.rst +++ b/README.rst @@ -355,6 +355,10 @@ Bugs and pull requested can be submitted on GitHub_. Changes ======= +1.1 +~~~ +* BUG: Read source files as bytes. + 1.0 ~~~ * ENH: `kernprof.py` is now installed as `kernprof`. diff --git a/kernprof.py b/kernprof.py index 5271a55..13161ee 100755 --- a/kernprof.py +++ b/kernprof.py @@ -30,7 +30,7 @@ exec_ = getattr(builtins, "exec") def execfile(filename, globals=None, locals=None): - with open(filename) as f: + with open(filename, 'rb') as f: exec_(compile(f.read(), filename, 'exec'), globals, locals) # =====================================