summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pep263.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2008-03-17 20:43:42 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2008-03-17 20:43:42 (GMT)
commit259314622750c72de2ef377e77a0b70b8d8b2fb5 (patch)
tree089ad865c7be59bf68fd72e0d5c18c12d831e345 /Lib/test/test_pep263.py
parentddaa7064ee81c48adc4fdea327892c29179f7845 (diff)
downloadcpython-259314622750c72de2ef377e77a0b70b8d8b2fb5.zip
cpython-259314622750c72de2ef377e77a0b70b8d8b2fb5.tar.gz
cpython-259314622750c72de2ef377e77a0b70b8d8b2fb5.tar.bz2
Bug #2301: Don't try decoding the source code into the original
encoding for syntax errors.
Diffstat (limited to 'Lib/test/test_pep263.py')
-rw-r--r--Lib/test/test_pep263.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_pep263.py b/Lib/test/test_pep263.py
index cc126ba..92065c9 100644
--- a/Lib/test/test_pep263.py
+++ b/Lib/test/test_pep263.py
@@ -23,6 +23,13 @@ class PEP263Test(unittest.TestCase):
exec(c, d)
self.assertEqual(d['u'], '\xf3')
+ def test_issue2301(self):
+ try:
+ compile(b"# coding: cp932\nprint '\x94\x4e'", "dummy", "exec")
+ except SyntaxError as v:
+ self.assertEquals(v.text, "print '\u5e74'")
+ else:
+ self.fail()
def test_main():
test_support.run_unittest(PEP263Test)