Hi,
I am working on the standalone PsychoPy3 platform and I have been trying to load psydat files generated from PsychoPy version 1.85.1. Running “fromFile(filename)” gives me the following error:
Exception ignored in: <bound method ExperimentHandler.del of <psychopy.data.experiment.ExperimentHandler object at 0x10a9010b8>>
Traceback (most recent call last):
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/data/experiment.py”, line 109, in del
self.close()
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/data/experiment.py”, line 391, in close
if self.dataFileName not in [’’, None]:
AttributeError: ‘ExperimentHandler’ object has no attribute ‘dataFileName’
Traceback (most recent call last):
File path_to_script, line 21, in
datFile = fromFile(filename)
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/tools/filetools.py”, line 55, in fromFile
contents = pickle.load(f)
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xd5 in position 0: ordinal not in range(128)
I then tried opening the psydat files after unpickling them using the following:
with open(filename, ‘rb’) as f:
datFile = pickle.load(f, encoding = “latin1”)
However, it seems that this opens the psydat files as an ExperimenterHandler object, rather than a TrialHandler object, so I cannot use commands such as datFile.data to extract the data conveniently. Instead, I have been looping through each trial as a dictionary and appending the trial information to lists, but I would ideally want to avoid this to make sure the code is not skipping through any trials.
I would appreciate your help resolving this issue.
Thank you!