File will not open
Hi there!
Yesterday I made some edits to my experiment, including adding an inline script. The experiment ran perfectly and I received no errors when I was running it. When I tried to open the experiment today, however, the experiment would not open and I received a ValueError (see below):
Errors occurred while opening the file:
Missing end block for multiline variable "_run" in item ReStudy_1
Details
item-stack: ``
time: Wed Sep 7 15:15:50 2016
Failed to parse line "set _prepare "#set max x and y resolution". Is there a closing quotation missing?
Details
item-stack: ``
exception message: No closing quotation
time: Wed Sep 7 15:15:52 2016
exception type: ValueError
Traceback (also in debug window)
File "/Applications/OpenSesame.app/Contents/Resources/lib/python2.7/site-packages/libopensesame/syntax.py", line 170, in split
return [safe_decode(_s) for _s in shlex.split(safe_encode(s))]
File "/Applications/OpenSesame.app/Contents/Resources/lib/python2.7/shlex.py", line 279, in split
return list(lex)
File "/Applications/OpenSesame.app/Contents/Resources/lib/python2.7/shlex.py", line 269, in next
token = self.get_token()
File "/Applications/OpenSesame.app/Contents/Resources/lib/python2.7/shlex.py", line 96, in get_token
raw = self.read_token()
File "/Applications/OpenSesame.app/Contents/Resources/lib/python2.7/shlex.py", line 172, in read_token
raise ValueError, "No closing quotation"
ValueError: No closing quotation
I tried changing the filename extension, and I tried looking at the code in a text editor. There isn't an open quotation. In the text editor, the contents of my inline script appear between quotation marks -- I guess this is the default way that OpenSesame saves info from inline code? However, it seems that I am unable to open the file when it saves like that. I've linked to the experiment file below in case you can recreate the same issue.
https://drive.google.com/open?id=0B1STlCrdBcafcmtjaXlaQ2lQY0E
Thank you in advance for your help!
Comments
I'd appreciate any help I can get with this... It's a bit of a time sensitive issue. Thank you!
OpenSesame 3.0.7 is a bit more informative on the error. Maybe that helps:
Best,
Jarik
Hi Allison,
I'll see if I can figure out what's wrong as soon as I have the time. For now, you can simply delete the offending line from the script in a text editor, so you can open it again in OpenSesame.
Also, what version of OpenSesame are you using?
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Thanks, Sebastiaan! I will try that, but I'm nervous about potentially losing more work until I figure out what's going on.
I was using 3.1.0, but I just upgraded to 3.1.2 and am receiving the same error. I have also tried to open it using both Windows and OSX, to no avail.
So using OpenSesame 3.0.7 which gives more informative error messages like:
I was able to repair inline_script ReStudy_1 and inline_script new_inline_script using a text editor.
I don't know what is going on/what caused this but I can tell you, you can download portable (no-install-needed) versions of OpenSesame like opensesame_3.0.7-py2.7-win32-3.zip from here that will not alter your system other than putting files on your hard disk. So you can safely use those to try to repair and figure out what's wrong.
Best
Jarik
I put the file on http://pastebin.com/7d4YU4Yj
@sebastiaan I can't upload file no more...
Hi Allision,
It's a very odd bug, but I think I can guess where it comes from: Did you copy-paste code from something like Microsoft Word (or another non-plain-text editor) into the
inline_script
item? If so, can you reliably reproduce the problem? And if so, how?Don't worry about losing data. This is really an unlikely (and recoverable) problem. And always use the latest version, unless there is a good reason not to (for example because you're already running the study)!
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
When I made the study originally, I coped and pasted code from a word document. The same issue happened when I coped and pasted code from a text editor. Once I closed the experiment and tried to open it again, those inline_script items did not appear. So, it seems like this is the issue. All of the code is accessible when I open the file in a text editor, however, so nothing was actually lost.
When I typed the code into the inline_script item, on the other hand, it saved and re-opened just fine. That being said, is there some way to avoid this issue, if I'd like to copy and paste a chunk of text from a previous experiment? I can't have two experiments open at once, so copying and pasting into a text editor is kind of necessary if I want to transfer larger chunks of code.
thank you so much for your help with this issue. And thanks to you, too, Jarik!
Allison