psychopy.org | Reference | Downloads | Github

Issue reading condition file

Hi, I am building an experiment with a loop that reads a condition file. When the file has a single column, the experiment runs, but when I add a second column I get an error:

Traceback (most recent call last):
File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\app\coder\coder.py”, line 2522, in runFile
fullPath = self.currentDoc.filename
AttributeError: ‘NoneType’ object has no attribute ‘filename’

I have deleted and recreated the loop and the condition file, used an xls and cvs format, and the error remains. Any ideas?
Thanks

I think the conditions file here is a red herring. The error is buried deep in Coder itself, where self.currentDoc is referring I think to your current .py file.

Although you don’t actually say when the error arises, I guess you could quit and restart PsychoPy, and copy your code into a fresh .py file?

Thanks, Michael,

I tried your suggestion and it didn’t work. I also created a new experiment with new files, and still the same problem. I used a previous experiment that draws audio stimuli (through the audio component) from the conditions file, and that works, but when I switch it to a text component, I get the following error:

Traceback (most recent call last):
File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\app\coder\coder.py”, line 2522, in runFile
fullPath = self.currentDoc.filename
AttributeError: ‘NoneType’ object has no attribute ‘filename’

SyntaxError: invalid syntax

The corresponding line is:

filename = os.path.split(fullPath)[1]