mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-44827: Improve error if BOM on first line of .po file (GH-130187)
This commit is contained in:
parent
185ac5adaf
commit
01ba7df499
2 changed files with 18 additions and 0 deletions
|
@ -39,6 +39,14 @@ class CompilationTest(unittest.TestCase):
|
|||
|
||||
self.assertDictEqual(actual._catalog, expected._catalog)
|
||||
|
||||
def test_po_with_bom(self):
|
||||
with temp_cwd():
|
||||
Path('bom.po').write_bytes(b'\xef\xbb\xbfmsgid "Python"\nmsgstr "Pioton"\n')
|
||||
|
||||
res = assert_python_failure(msgfmt, 'bom.po')
|
||||
err = res.err.decode('utf-8')
|
||||
self.assertIn('The file bom.po starts with a UTF-8 BOM', err)
|
||||
|
||||
def test_invalid_msgid_plural(self):
|
||||
with temp_cwd():
|
||||
Path('invalid.po').write_text('''\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue