mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
Merge branch
This commit is contained in:
commit
fed2c51eea
3 changed files with 8 additions and 1 deletions
|
|
@ -745,6 +745,10 @@ def test_utf8_coding_cookie_and_utf8_bom(self):
|
|||
f = 'tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt'
|
||||
self.assertTrue(self._testFile(f))
|
||||
|
||||
def test_bad_coding_cookie(self):
|
||||
self.assertRaises(SyntaxError, self._testFile, 'bad_coding.py')
|
||||
self.assertRaises(SyntaxError, self._testFile, 'bad_coding2.py')
|
||||
|
||||
|
||||
class Test_Tokenize(TestCase):
|
||||
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ def find_cookie(line):
|
|||
raise SyntaxError(msg)
|
||||
|
||||
if bom_found:
|
||||
if codec.name != 'utf-8':
|
||||
if encoding != 'utf-8':
|
||||
# This behaviour mimics the Python interpreter
|
||||
if filename is None:
|
||||
msg = 'encoding problem: utf-8'
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ Core and Builtins
|
|||
Library
|
||||
-------
|
||||
|
||||
- Issue #14990: Correctly fail with SyntaxError on invalid encoding
|
||||
declaration.
|
||||
|
||||
- Issue #14814: ipaddress now provides more informative error messages when
|
||||
constructing instances directly (changes permitted during beta due to
|
||||
provisional API status)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue