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

undo_manager crashes when the script fails to parse due to a missing closing quotation #734

Open
smathot opened this issue Oct 28, 2020 · 1 comment
Assignees

Comments

@smathot
Copy link
Collaborator

smathot commented Oct 28, 2020

This came in as an automated bug report. It appears to happen because the (intentional) exception that is raised when a closing quotation is missing causes the undo_manager extension to crash.

Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\syntax.py", line 185, in split
    return shlex.split(s)
  File "C:\Program Files (x86)\OpenSesame\lib\shlex.py", line 310, in split
    return list(lex)
  File "C:\Program Files (x86)\OpenSesame\lib\shlex.py", line 299, in __next__
    token = self.get_token()
  File "C:\Program Files (x86)\OpenSesame\lib\shlex.py", line 109, in get_token
    raw = self.read_token()
  File "C:\Program Files (x86)\OpenSesame\lib\shlex.py", line 191, in read_token
    raise ValueError("No closing quotation")
ValueError: No closing quotation

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libqtopensesame\extensions\_extension_manager.py", line 41, in inner
    retval = fnc(self, *args, **kwdict)
  File "C:\Program Files (x86)\OpenSesame\share\opensesame_extensions\undo_manager\undo_manager.py", line 207, in undo
    self.experiment.items[item].from_string(script)
  File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\loop.py", line 77, in from_string
    self.parse_variable(i)
  File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\item.py", line 132, in parse_variable
    l = self.syntax.split(line.strip())
  File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\syntax.py", line 192, in split
    % s, exception=e)
libopensesame.exceptions.osexception: 
Failed to parse line "[masked for privacy]". Is there a closing quotation missing?
@smathot smathot added the Bug label Oct 28, 2020
@smathot smathot self-assigned this Oct 28, 2020
@smathot
Copy link
Collaborator Author

smathot commented Nov 24, 2020

It's unclear how this error can arise, because it seems to require that a syntactically invalid script is pushed to the undo stack, and that strikes me as impossible. Yet the error is there. Perhaps it happens for a specific item type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant