[solved] 'ascii' codec can't decode byte 0xc3 in position 27: ordinal not in range
Even though I already found another entry on this problem, I think, I cannot solve it the same way in my case but putting a 'u in the logger :P
So what happened: the experiment runs fine on my laptop but not on the computers in the lab at university.
It crashes as soon as a loop containin an inline script to set the string according to the current value of a variable, a form which contains some text, a picture, some checkboxes, a button and another inline script which creates a new variable each cycle of the loop, so that I only need one logger-Item in the end and have my values in one line.
Here's the error message in the debugging window:
Unexpected error
line: 874
exception message:
exception type: UnicodeDecodeError
Traceback:
File "dist\libqtopensesame\misc\process.py", line 130, in run
File "dist\libopensesame\experiment.py", line 291, in run
File "dist\libopensesame\sequence.py", line 56, in run
File "dist\libopensesame\loop.py", line 145, in run
File "dist\libopensesame\sequence.py", line 56, in run
File "C:\Program Files (x86)\OpenSesame\plugins\form_base\form_base.py", line 136, in run
File "dist\libopensesame\widgets\form.py", line 112, in _exec
File "dist\libopensesame\widgets\form.py", line 224, in render
File "dist\libopensesame\widgets\image.py", line 73, in render
File "dist\openexp\_canvas\legacy.py", line 874, in image
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 27: ordinal not in range(128)
OS on the lab computers, where it crashes, is Win 7 Enterprise 64bit
OS on my Laptop where it was created and runs propperly is Win 8.1 64bit
I'd be thankful for a solution. Meanwhile participants use my laptop.
Cheers!
Comments
Hi,
The error message that you see results from a problem in parsing the actual error message. In other words, the actual error message is obscured by a bug in OpenSesame's exception handling system. To see what's going, you try the following code in an
inline_script
:... replace
my_filename.png
by the name of the problematic file in the file pool. This script should still crash, but hopefully provide a more informative error message.Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
Had to change the inline script slightly to match my usage:
The Error code now produced by this new inline script is as following:
An image 52.png exists in the same folder as the experiment. And adding all the pictures to the file pool did not help either.
The correct code would actually be:
The
u
should be before the quotation marks if you use it to denote a unicode string. Currently, your image name is defined asu'52.png'
rather than52.png
Thanks Edwin for the correction.
And I just realized it's jpg not png, so I corrected the path accordingly. Could the jpg-format cause the problem?
Now the error is:
Still, all pictures are in the same folder as the experiment and all pictures were added to the file pool.
But don't worry too much, it's not critical anymore. I got used to make my participants switch seats and use my laptop for this part.
Hi,
It seems OpenSesame still can't find the file. One thing that comes to mind, is using the neat way of getting file paths, using the function that @sebastiaan had already mentioned:
This way is preferred, as some systems are not particularly fond of abbreviated paths (i.e.: not using the full path, but just the name of a file in the working directory).
Good luck!
Even though the thread was meanwhile marked as solved, I must admit, I just didn't try it anymore on the lab's PCs and just used my laptop. Meanwhile I'm done with this study. So thank you for all the support, Edwin and Sebastiaan! (a short review concerning the mobile part will be given in the runtime environment threat)