OS : Ubuntu 20.04 PsychoPy version: 2021.2.2 Standard Standalone
When I type a dollar sign ($) at the beginning of a text component, Builder gives an error and crashes.
If I type the $ at a different position in the box, nothing happens (please, see the gif below):
Traceback (most recent call last):
File “/home/flavio/.local/lib/python3.8/site-packages/psychopy/app/builder/dialogs/paramCtrls.py”, line 29, in validate
File “/home/flavio/.local/lib/python3.8/site-packages/psychopy/app/builder/dialogs/paramCtrls.py”, line 442, in validate
val = str(obj.GetValue())
RecursionError: maximum recursion depth exceeded while calling a Python object
It happens in a new file - I just have to start Builder and insert a text component.
The same was not happening with the previous version of Psychopy (same OS and machine).
I can confirm that this happens on the latest PsychoPy on Manjaro (i.e. Arch-based distro) as well. I think that may mean this happens on all Linux systems. The error message suggest that some recursive function in the program simply repeats infinitely, but I’ll keep looking for solutions.
Yes, my friend! I’m using the recent version.
When I use the dollar sign in any text area, as in random variables in sense to create aleatory reading, the builder closes Psychopy.
I have no idea what happens.
I noticed the dollar sign is used as a delimiter to code in text fields, inside Psychopy.
However, the same sign maybe interpreted as an illegal mark by Python interpreter in the recent version, as in the example in Python:
fred$ = ‘alex’
SyntaxError: invalid syntax
I really not use this above syntax, otherwise, the properly $text to text variable in the text fields.
I tried to install older versions, within and without virtual environments, and the same crash appears again. I use Ubuntu 20.04 with Psychopy 2021.2.3.
I personally resolve this task once creating the experiment in the builder, insert the variables in the text field with space before, and, modified the variables directly in Python code, removing the dollar sign.
The experiment runs perfectly.
Nevertheless, if you choose to stay with the same Psychopy version (again, assuming that this is your case), you can modify the contents of the file paramCtrls.py (usually installed under home/user/.local/lib/python3.8/site-packages/psychopy/app/builder/dialogs/paramCtrls.py). The modification needed is described here.
If you are not familiarized with the notation used there: the signs indicate one line to delete (-) and two lines to insert (+), with one of them commented (# in the beginning of the line). Save the file and you are good to go
Please, post here if you manage to solve the problem you’ve been having.
Thanks for posting the version of Psychopy you are using.
I upgraded my installation to version 2022.2.4 and was able to replicate the error you are experiencing (Psychopy crashes) in my Ubuntu 22.04. So, somehow, this bug found its way back
Well, the paramsCtrl.py file is different in this version (compared to the one I pointed you to above) but the error, apparently, has the same culprit.
The good news is that I could get rid of it by commenting lines 56 to 66.
The print below shows how my paramsCtrl.py file looks like now:
Yes, you just need to edit and save the file using any text editor.
You can do this via terminal or using your file manager (I believe Kubuntu uses Dolphin by default).
Using the terminal, you can open paramsCtrl.py using any text editor (gedit, kate, etc.), as long as you know the path to the file (i.e. its location). If you know where your Psychopy files are, paramCtrls.py can be found under /lib/python3.8/site-packages/psychopy/app/builder/dialogs/paramCtrls.py
So, for instance, you can open paramCtrls.py using gedit by typing in the terminal: