#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

# IOError, Picture file does not exist (but it does)

Hi all,

My lab occasionally gets an error of the type IOError with the message "The picture file [name of file] does not exist." We get the error inconsistently and not that often in two different experiments. The one time I have been present to take a look, I opened the file pool inspector and there were no images in the pool. Then I closed and re-opened the experiment, and the pool was full again. Here is the full message from that incident. Thanks for any advice you have.

Stopped

The experiment did not finish normally for the following reason:

Unexpected error
Details

item-stack: experiment[run].TX[run].TX_sequ[prepare].CS[prepare]
exception type: IOError
exception message: The picture file 'face3.jpg' does not exist
time: Thu Nov 29 04:23:26 2018
Traceback (also in debug window)

  File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libqtopensesame\misc\process.py", line 157, in run
exp.run()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\experiment.py", line 456, in run
self.items.execute(self.var.start)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 103, in execute
self.run(name)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
self[name].run()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\sequence.py", line 51, in run
self.experiment.items.run(_item)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
self[name].run()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\loop.py", line 347, in run
self.experiment.items.execute(self._item)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 102, in execute
self.prepare(name)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 142, in prepare
self[name].prepare()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\sequence.py", line 124, in prepare
self.experiment.items.prepare(_item)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 142, in prepare
self[name].prepare()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\sketchpad.py", line 149, in prepare
temp_name, element.element_name
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\openexp\_canvas\canvas.py", line 354, in __exit__
self.prepare()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\openexp\_canvas\canvas.py", line 775, in prepare
element.prepare()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\openexp\_canvas\_image\xpyriment.py", line 31, in prepare
self._stim = Picture(filename=safe_decode(self.fname))
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\expyriment\stimuli\_picture.py", line 49, in __init__
unicode2byte(filename)))
IOError: The picture file 'face3.jpg' does not exist



• Can you reliably reproduce this error? This would be very useful. Otherwise it is hard to deal with this issue. Maybe it has to do with garbage collection or the pool is cleared out for some reason? But honestly, I am fishing in the dark here.

Eduard

• I'll take any advice I can get Thanks Eduard. I can't reliably reproduce the error. It happens in two different experiments unpredictably at a low frequency. I wasn't even going to post about it because it's rare and odd, but it happened just enough times for me to bring it to the community's attention. This might not be the garbage collection you have in mind, but we have cleared all the unused items (thanks to the update that allows you to do that quickly).

• edited February 8

Hi all,

This inexplicable IO error has been happening with more regularity in another experiment. In this case, we can see the file in the file pool that supposedly is not available (it's a disgust experiment, hence the image name).

Although I cannot reproduce the error reliably, there is some consistency: When it occurs, it always occurs in the last trial in a block of 16 trials (The "Trials" loop is called twice in the experiment; it happens on either the first or second call, always at the start of the final trial). Is that clue helpful?

We have a workaround for the crash, but any advice would be greatly appreciated.

Thanks,

## Tom

The experiment did not finish normally for the following reason:

Unexpected error
Details

item-stack: experiment[run].Trials[run].Trials_sequ[prepare].image_array[prepare]
exception type: IOError
exception message: The picture file 'Poop.jpg' does not exist
time: Fri Feb 08 12:51:32 2019
Traceback (also in debug window)

  File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libqtopensesame\misc\process.py", line 157, in run
exp.run()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\experiment.py", line 456, in run
self.items.execute(self.var.start)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 103, in execute
self.run(name)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
self[name].run()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\sequence.py", line 51, in run
self.experiment.items.run(_item)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
self[name].run()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\loop.py", line 347, in run
self.experiment.items.execute(self._item)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 102, in execute
self.prepare(name)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 142, in prepare
self[name].prepare()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\sequence.py", line 124, in prepare
self.experiment.items.prepare(_item)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 142, in prepare
self[name].prepare()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\sketchpad.py", line 149, in prepare
temp_name, element.element_name
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\openexp\_canvas\canvas.py", line 354, in __exit__
self.prepare()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\openexp\_canvas\canvas.py", line 775, in prepare
element.prepare()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\openexp\_canvas\_image\xpyriment.py", line 31, in prepare
self._stim = Picture(filename=safe_decode(self.fname))
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\expyriment\stimuli\_picture.py", line 49, in __init__
unicode2byte(filename)))
IOError: The picture file 'Poop.jpg' does not exist

• Independent of the actual images used? Can you use an inline_script either instead of before the sketchpad and check whether you can access the stimuli in that way?

Eduard