You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Avoid SyntaxError when loading modules encoded in UTF8 with BOM
Changed the encoding from `utf8` to `utf-8-sig` throughout the code base when reading files, in order to ignore a possible byte-order mark (a.k.a. BOM, code point U+FEFF) at the start of the file.
As per [the Python documentation](https://docs.python.org/3/howto/unicode.html#reading-and-writing-unicode-data):
> In some areas, it is also convention to use a “BOM” at the start of UTF-8 encoded files; the name is misleading since UTF-8 is not byte-order dependent. The mark simply announces that the file is encoded in UTF-8. For reading such files, use the ‘utf-8-sig’ codec to automatically skip the mark if present.
This change won't affect reading UTF8-encoded files without a BOM.
Issue-386: #386
PR-387: #387
Co-authored-by: Timothée Mazzucotelli <[email protected]>
0 commit comments