Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Space character in column name of conditions file yields UnboundLocalError in Builder #6438

Open
hoechenberger opened this issue May 6, 2024 · 0 comments
Labels
🐞 bug Issue describes a bug (crash or error) or undefined behavior.

Comments

@hoechenberger
Copy link
Contributor

hoechenberger commented May 6, 2024

PsychoPy Version

v2024.1.4

What OS are your PsychoPy running on?

macOS Silicon

Bug Description

Adding a loop with a conditions CSV file that has a space in at least of the column names yields, immediately after selecting the file:

Traceback (most recent call last):
  File/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/dialogs/__init__.py”, line 1681, in onBrowseTrialsFile
  File/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/dialogs/__init__.py”, line 1715, in updateSummary
  File/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/data/utils.py”, line 499, in importConditions
UnboundLocalError: local variabletrialListreferenced before assignment

Expected Behaviour

PsychoPy should parse the conditions file

Steps to Reproduce

  1. Create a CSV file with e.g. the following content:

    Col1,Col 2
    Foo,Bar
    
  2. In Builder, Insert Loop and select the CSV file for Condition

Additional context

Removing the space (Col 2 -> Col2) works around the problem.

Has been reported on the forum before:
https://discourse.psychopy.org/t/unboundlocalerror-local-variable-triallist-referenced-before-assignment/13472

@hoechenberger hoechenberger added the 🐞 bug Issue describes a bug (crash or error) or undefined behavior. label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Issue describes a bug (crash or error) or undefined behavior.
Projects
None yet
Development

No branches or pull requests

1 participant