[LDTP-Dev] UTF-8 characters in settextvalue method

Ara Pulido ara at ubuntu.com
Thu Jul 31 02:38:57 PDT 2008


Hello all,

I am trying to write a script that will open a Gedit session, will write
some japanese chracters, will save and it will be compared to an already
saved file.

The same test using ascii characters works neatly, but in this case I
always get this error:

Traceback (most recent call last): File "/usr/bin/ldtprunner", line
424, in executescript execfile (scriptname, scriptglobal) File
"gedit_chains.py", line 24, in <module> test.write_text(chain) File
"/usr/lib/python2.5/site-packages/ubuntutesting/ubuntu.py", line 138, in
write_text Application.write_text(self, text,
ubuntu_constants.GE_TXT_FIELD) File
"/usr/lib/python2.5/site-packages/ubuntutesting/ubuntu.py", line 118, in
write_text app_txt_field.settextvalue(text) File
"/var/lib/python-support/python2.5/ooldtp.py", line 453, in settextvalue
return ldtp.settextvalue (self.__window, self.getName (''), args [0])
File "/var/lib/python-support/python2.5/ldtp.py", line 805, in
settextvalue _message = generatexml (command.SETTEXTVALUE, _requestId,
windowName, componentName, text) File
"/var/lib/python-support/python2.5/ldtp.py", line 84, in generatexml
_argDebug += ", " + str (args [index]) UnicodeEncodeError: 'ascii' codec
can't encode characters in position 27-30: ordinal not in range(128)

I have tried encoding that, but finally ldtp library always tries to
encode that to ascii.

Have you managed to get such a test running successfully?

Thanks,
Ara.



More information about the LDTP-dev mailing list