Compiled Builder programs restart during trials loop when run in Coder

I’m running PsychoPy v2024.1.5 on a Windows PC.

If I compile any Builder program (including the Stroop demo program) to generate Python code and then run the Python code in Coder, the program attempts to restart a few seconds after starting the trials loop.

The attempt to restart is evident from the appearance of a second ‘expinfo’ dialog window. If I click ‘OK’ in the dialog, the program restarts, then again displays an ‘expinfo’ dialog window a few seconds after starting the trials loop (and so on, ad infinitum, if I keep clicking ‘OK’); if I click ‘Cancel’ (or do nothing, leaving the dialog alone), the program continues as normal. If I comment out the line in the program that calls the ‘showExpInfoDlg’ function (and provide my own value in the code for the ‘expInfo.participant’ variable to prevent the program from crashing), the program skips the ‘expinfo’ dialog window and simply restarts a few seconds after starting the trials loop, then restarts again a few seconds after starting the trials loop, and so on.

Interestingly, if I click the display with the mouse while on the instructions page (i.e. before starting the trials loop), the program no longer attempts to restart a few seconds after starting the trials loop. I thought at first that clicking the display with the mouse might simply be bringing the display to the front and thereby hiding the second ‘expinfo’ dialog window, but I can see that this is not the case, for several reasons. First, if I wait for the second ‘expinfo’ dialog window to appear before clicking the main display with the mouse, the ‘expinfo’ dialog window is hidden, but becomes visible after the program ends, whereas if I click the display with the mouse while on the instructions page there is not an ‘expinfo’ dialog window visible after the program ends. Moreover, if I comment out the line in the program that calls the ‘showExpInfoDlg’ function, clicking the display with the mouse while on the instructions page prevents the program from restarting a few seconds after the start of the trials loop, and this clearly has nothing to do with putting the restart on hold by hiding the ‘expinfo’ dialog window. So, clicking the display with the mouse while on the instructions page actually prevents the program from attempting to restart.

I have also tried clicking the display with the mouse after the onset of the trials loop but before the second ‘expinfo’ dialog window appears (since there is always a delay of a few seconds before it appears). With the unmodified version of the program that calls the ‘showExpInfoDlg’ function, this prevents the second ‘expinfo’ dialog window from appearing but it is in fact present and hidden behind the main display, since it becomes visible after the program ends. With the modified version of the program that does not call the ‘showExpInfoDlg’ function, clicking the display with the mouse after the onset of the trials loop but before the second ‘expinfo’ dialog window prevents the program from restarting, which does not seem consistent with the behaviour of the unmodified program.

Hello @rdkirkden

This is rather bizzare. Do you know that you can turn off the info dialog by unselecting it in the Experiment Properties?

Do you mind posting your experiment? I’d like to take a look.

Best wishes Jens

Hi Jens,

It’s not anything special about my experiment, it affects the demo tasks too, the Stroop at any rate. I upload my compiled code for the Stroop demo. Also, it’s not really about the info dialog, as turning this off doesn’t prevent the program from restarting.
stroop.py (35.9 KB)

Best wishes,
Richard

Hello @rdkirkden

Do you have a *.psyexp file?

Best wishes Jens

Sure, here it is.
stroop.zip (21.8 KB)

Hello @rdkirkden

The stroop-experiment runs on my computer without any problems from within the Builder and the Coder.

PsychoPy 2024.2.4

Paths to files on the system:
demos: C:\Program Files\PsychoPy\lib\site-packages\psychopy\demos
appFile: C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\PsychoPy.py

System Info:
Operating System: Windows-10-10.0.26100-SP0
Processor: Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
CPU freq (MHz): 2803.0
CPU cores: 4 (physical), 8 (logical)
Installed memory: 34065145856 (Total), 22487941120 (Available)

Python info:
Executable path: C:\Program Files\PsychoPy\pythonw.exe
Version: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
(Selected) Installed Packages:
numpy (1.26.4)
scipy (1.14.1)
matplotlib (3.9.2)
pyglet (1.4.11)
PyGLFW [not installed]
pyo [not installed]
psychtoolbox (3.0.19.14)
wxPython (4.2.2)

OpenGL Info:
Vendor: Intel
Rendering engine: Intel(R) Iris(R) Xe Graphics
OpenGL version: 4.6.0 - Build 32.0.101.5972
Shaders supported: True
(Selected) Extensions:
GL_ARB_multitexture: True
GL_EXT_framebuffer_object: True
GL_ARB_fragment_program: True
GL_ARB_shader_objects: True
GL_ARB_vertex_shader: True
GL_ARB_texture_non_power_of_two: True
GL_ARB_texture_float: True
GL_STEREO: False
max vertices in vertex array: 1048576

Best wishes Jens

Oh well, thanks for taking the time to have a look :slight_smile:
Best wishes, Richard