Merge pull request #3495 from NightFurySL2001/patch-2

Allow UTF-8 with BOM for features.fea
This commit is contained in:
Cosimo Lupo 2024-05-30 12:27:21 +01:00 committed by GitHub
commit 4193aeaa26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -269,7 +269,7 @@ class IncludingLexer(object):
fileobj, closing = file_or_path, False fileobj, closing = file_or_path, False
else: else:
filename, closing = file_or_path, True filename, closing = file_or_path, True
fileobj = open(filename, "r", encoding="utf-8") fileobj = open(filename, "r", encoding="utf-8-sig")
data = fileobj.read() data = fileobj.read()
filename = getattr(fileobj, "name", None) filename = getattr(fileobj, "name", None)
if closing: if closing: