fix(eyetracking): read eyelink calibration files as UTF-8 (#14000) - #14002
Merged
larsoner merged 3 commits intoJun 30, 2026
Conversation
…14000) read_eyelink_calibration() decoded .asc files as ASCII, which raised a UnicodeDecodeError when a "MSG" line contained non-ASCII characters (e.g. a zero-width no-break space, U+FEFF). MSG lines are not guaranteed to be ASCII since users may include UTF-8 text in their messages, and read_raw_eyelink() already reads these files without issue. Decode as UTF-8 instead (ASCII is a subset, so existing files are unaffected). Adds a regression test that injects non-ASCII content into a MSG line, plus a changelog entry.
CedricConday
requested review from
agramfort,
drammock and
larsoner
as code owners
June 29, 2026 22:45
Member
|
Pre-commit CI failed can you either modify the line or add |
Contributor
Author
|
Thanks! Fixed in 2565238 — reworded the test message to drop the |
larsoner
approved these changes
Jun 29, 2026
larsoner
left a comment
Member
There was a problem hiding this comment.
Marking for merge when green, thanks in advance @CedricConday !
|
🎉 Congrats on merging your first pull request! 🥳 Looking forward to seeing more from you in the future! 💪 |
CedricConday
added a commit
to CedricConday/mne-python
that referenced
this pull request
Jul 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference
Closes #14000
What was wrong
mne.preprocessing.eyetracking.read_eyelink_calibration()decoded the.ascfile as ASCII:When a
MSGline contained a non-ASCII character (e.g. a zero-width no-break space, U+FEFF, which encodes to the0xefbyte from the traceback), this raisedUnicodeDecodeErrorand the whole read failed. As the reporter notes,MSGlines are not guaranteed to be ASCII — users may put UTF-8 text in their messages — andmne.io.read_raw_eyelink()already reads the same files without issue.Fix
Decode as UTF-8 instead. ASCII is a subset of UTF-8, so existing all-ASCII files are unaffected; this only widens what can be read. This matches the maintainer's suggestion in the issue thread ("I think we should decode as UTF8. If later we need to add a param to control this we can").
Test
Adds
test_calibration_non_ascii, mirroring the existingtest_calibration_newlines: it injects aMSGline containing non-ASCII content (including U+FEFF, the exact character that triggered the original crash) into the testing.asc, then asserts the calibration reads without error and the parsed values are unchanged.