error mne.io.read_raw_cnt()

mne.io.read_raw_cnt(cnt_file_path, eog=‘auto’, ecg=‘auto’, data_format=‘auto’, preload=True, verbose=None)

this is the error :
----> 2 mne.io.read_raw_cnt(cnt_file_path, eog=‘auto’, ecg=‘auto’, data_format=‘auto’, preload=True, verbose=None)

c:\projects\algos_toolchain.venv\lib\site-packages\mne\io\cnt\cnt.py in read_raw_cnt(input_fname, eog, misc, ecg, emg, data_format, date_format, preload, verbose)
164 return RawCNT(input_fname, eog=eog, misc=misc, ecg=ecg,
165 emg=emg, data_format=data_format, date_format=date_format,
→ 166 preload=preload, verbose=verbose)
167
168

c:\projects\algos_toolchain.venv\lib\site-packages\mne\io\cnt\cnt.py in init(self, input_fname, eog, misc, ecg, emg, data_format, date_format, preload, verbose)
392 input_fname = path.abspath(input_fname)
393 info, cnt_info = _get_cnt_info(input_fname, eog, ecg, emg, misc,
→ 394 data_format, _date_format)
395 last_samps = [cnt_info[‘n_samples’] - 1]
396 super(RawCNT, self).init(

c:\projects\algos_toolchain.venv\lib\site-packages\mne\io\cnt\cnt.py in _get_cnt_info(input_fname, eog, ecg, emg, misc, data_format, date_format)
175 with open(input_fname, ‘rb’, buffering=0) as fid:
176 fid.seek(21)
→ 177 patient_id = read_str(fid, 20)
178 patient_id = int(patient_id) if patient_id.isdigit() else 0
179 fid.seek(121)

c:\projects\algos_toolchain.venv\lib\site-packages\mne\io\utils.py in read_str(fid, count)
242 b’\x00’ in data else count]])
243
→ 244 return str(bytestr.decode(‘ascii’)) # Return native str type for Py2/3
245
246

UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xa5 in position 0: ordinal not in range(128)

Welcome to the MNE Forum @Hadary0712 !

We’ve seen (and fixed) similar errors with our Nihon reader:

And similar CNT errors have been reported before: Error reading *.cnt eeg file

One important note is that there are 2 different file formats that both call themselves .cnt files: Neuroscan CNT data format and ANTNeuro CNT format. MNE-Python’s reader only works for Neuroscan format. We have an open issue discussing support for ANTNeuro files: ENH: import ANT Neuro .CNT files (some code available) · Issue #3609 · mne-tools/mne-python · GitHub On that thread, this comment nicely summarizes the currently available workarounds.

If you’re getting this error with a Neuroscan CNT file then what we need to be able to fix it is a sample file that causes the error, so we can locally reproduce and then debug. Can you provide such a file?

I don’t know from which device it was provided, but I can check,
Here is the file I am trying to work with
1001_1001_2023-02-10_09-43-39.cnt

‫בתאריך יום ד׳, 9 באוג׳ 2023 ב-21:11 מאת ‪Dan McCloy via MNE Forum‬‏ <‪notifications@mne.discoursemail.com‬‏>:‬

file is restricted access; you’ll need to approve my access request (or make it unrestricted)