2012/6/15 Fabio <
fabrice....@gmail.com>:
>
> Now, i get an encoding error each time I run pybot, while the system is
> generating the junit report file.
I was able to reproduce the problem. In practice creating xunit
reports fails if a test has failed with a message containing non-ASCII
characters. This seems to be a regression in RF 2.7.2, or at least I
wasn't able to reproduce it with RF 2.7.1.
Could you submit an issue about this problem to the tracker? Fixing
the bug seems to be pretty simple and we ought to be able to get the
fix into 2.7.3.
> Let me take an example to explain my issue.
> First, I have an external utf-8 encoded variable file (I had to add the "u"
> caracter to make python understand that the string contains utf-8 caracters)
> :
>
> # -*- coding: utf-8 -*-
> MY_UTF8_VARIABLE = u"Changer un robinet est une opération délicate\r\nque
> vous pouvez entreprendre vous-même en étant organisé et\r\nrigoureux.
> Changer un robinet de radiateur peut être l’occasion de\r\nremplacer
> l’ancien modèle par un robinet thermostatique qui vous\r\nap"
Actually that "u" made the string Unicode in Python. Declaring UTF-8
encoding in the file allowed you to use non-ASCII characters to create
it. Otherwise you would have needed to escape them line \ue4. This
doesn't really have anything to with the bug you reported, though, and
you don't actually even need a variable file to reproduce it. Having
something like this in your test case file is enough:
*** Test Cases ***
Example
Fail Hyvää yötä
Cheers,
.peke
--
Agile Tester/Developer/Consultant ::
http://eliga.fi
Lead Developer of Robot Framework ::
http://robotframework.org