mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Fix Bug #1378022, UTF-8 files with a leading BOM crashed the interpreter.
Needs backport.
This commit is contained in:
parent
e7214a130b
commit
db83eb3170
5 changed files with 19 additions and 2 deletions
2
Lib/test/bad_coding2.py
Normal file
2
Lib/test/bad_coding2.py
Normal file
|
@ -0,0 +1,2 @@
|
|||
#coding: utf8
|
||||
print '我'
|
|
@ -5,6 +5,13 @@ import os
|
|||
class CodingTest(unittest.TestCase):
|
||||
def test_bad_coding(self):
|
||||
module_name = 'bad_coding'
|
||||
self.verify_bad_module(module_name)
|
||||
|
||||
def test_bad_coding2(self):
|
||||
module_name = 'bad_coding2'
|
||||
self.verify_bad_module(module_name)
|
||||
|
||||
def verify_bad_module(self, module_name):
|
||||
self.assertRaises(SyntaxError, __import__, 'test.' + module_name)
|
||||
|
||||
path = os.path.dirname(__file__)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue