Using v1.73.04 - error, won't run file

27 views
Skip to first unread message

susan

unread,
Feb 29, 2012, 4:50:35 PM2/29/12
to psychopy-users
Hello

I've just started using the lastest version of psychopy and it won't
run any of my old programs, or a new program that I've written. It
gives the error below.
It runs the first part of the program so that I can type in age, pt no
etc, then crashes.

Please can anyone give any advice as to how I might fix this?

Thanks for your help,

Susan

File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.6/
pyglet/text/document.py", line 428, in _insert_text
self._text = u''.join((self._text[:start], text,
self._text[start:]))
TypeError: sequence item 1: expected string or Unicode, NoneType found

susan

unread,
Feb 29, 2012, 4:52:15 PM2/29/12
to psychopy-users
This is the associated text from the coder (starting at line 427):

def _insert_text(self, start, text, attributes):
self._text = u''.join((self._text[:start], text,
self._text[start:]))
len_text = len(text)
for element in self._elements:
if element._position >= start:
element._position += len_text

Jonathan Peirce

unread,
Mar 1, 2012, 3:58:52 AM3/1/12
to psychop...@googlegroups.com
Hi Susan,

It's failing at the point of inserting the new string for some text
stimulus. Could you tell us what text you're trying to present (possibly
send your excel file?). I wonder especially if you have any interesting
(non-alphanumeric) characters in there.

best wishes,
Jon

--
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk


This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

susan

unread,
Mar 1, 2012, 4:39:57 AM3/1/12
to psychopy-users
Hi Jon

Thanks for your email.

This is what is in my .csv file (90 rows):

cue List Emotion ratingpicture
decrease.png 3 2 neu (93).png

and this is in my first screen:

Welcome to the task!

You will be shown some pictures.

Before each picture you will be shown a cue:
Look / Enhance / Decrease

In response to these cues please adjust your reactions according to
the instructions you were given earlier.

Please ask the researcher if have any questions or you are unsure.

After each picture you will be asked to rate the emotion that you are
currently feeling.

Please use the following scales:
1 2 3 4 5 6 7 8 9
unhappy happy

1 2 3 4 5 6 7 8 9
very calm very excited

Press any key to continue.

As far as I can tell I don't have any non-alphanumeric characters.

Thanks for your help!

best wishes,
Susan

On Mar 1, 8:58 am, Jonathan Peirce <jonathan.pei...@nottingham.ac.uk>
wrote:

susan

unread,
Mar 1, 2012, 4:44:29 AM3/1/12
to psychopy-users
I have 2 trials in the experiment within the same loop which both show
an image from $ratingpicture. I'm not sure if this is part of the
problem? When I tried writing a new program last night it worked up
until the point where I added the 2nd trial within the same loop,
although I also tried it with drawing the 2nd image from
$ratingpicture 2 (and added a column to my .csv file) but this didn't
solve the problem.

Thanks for your time replying to my messages!

Susan

Jonathan Peirce

unread,
Mar 1, 2012, 4:49:12 AM3/1/12
to psychop...@googlegroups.com
The problem is definitely to do with pyglet failing to render some text.
So it's either in the instructions or text being drawn during the trial
(e.g. as part of the rating scale).

Could you zip the file and send it to me (possibly off-list)?

Jon

susan

unread,
Mar 2, 2012, 5:25:50 AM3/2/12
to psychopy-users
I reinstalled the latest version of psychopy which didn't fix it. I
then went through all the text screens as you suggested this is where
the problem would be, it turned out that the problem was with a text
screen that I had which was blank. It wouldn't run on my machine, my
mac, or a colleague's machine with the blank text screen but would run
when I put a space into the blank text screen so it still appears
blank but I suppose contains a character.

Thanks for all your help!

Susan

On Mar 1, 9:49 am, Jonathan Peirce <jonathan.pei...@nottingham.ac.uk>
Reply all
Reply to author
Forward
0 new messages