ignore the coding cookie in compile(), exec(), and eval() if the source is a string #4626
diff --git a/Lib/test/test_coding.py b/Lib/test/test_coding.py
index ade8bdf..51873b4 100644
--- a/Lib/test/test_coding.py
+++ b/Lib/test/test_coding.py
@@ -17,10 +17,10 @@
 
         path = os.path.dirname(__file__)
         filename = os.path.join(path, module_name + '.py')
-        fp = open(filename, encoding='utf-8')
-        text = fp.read()
+        fp = open(filename, "rb")
+        bytes = fp.read()
         fp.close()
-        self.assertRaises(SyntaxError, compile, text, filename, 'exec')
+        self.assertRaises(SyntaxError, compile, bytes, filename, 'exec')
 
     def test_exec_valid_coding(self):
         d = {}