Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Lib/test/test_importlib/source/test_source_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,10 @@ def test_encoding_on_second_line(self):
source = b"#/usr/bin/python\n" + self.create_source('Latin-1')
self.run_test(source)

# TODO: RUSTPYTHON
@unittest.expectedFailure
# [BOM]
def test_bom(self):
self.run_test(codecs.BOM_UTF8 + self.source_line.encode('utf-8'))

# TODO: RUSTPYTHON
@unittest.expectedFailure
# [BOM and utf-8]
def test_bom_and_utf_8(self):
source = codecs.BOM_UTF8 + self.create_source('utf-8')
Expand Down
4 changes: 4 additions & 0 deletions compiler/parser/src/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ where
lxr.window.slide();
lxr.window.slide();
lxr.window.slide();
// TODO: Handle possible mismatch between BOM and explicit encoding declaration.
if let Some('\u{feff}') = lxr.window[0] {
lxr.window.slide();
}
// Start at top row (=1) left column (=1)
lxr.location.reset();
lxr
Expand Down