planemo
planemo copied to clipboard
Planemo + R = 'ascii' codec can't encode character u'\u2018'
Hi all,
I'm used to wrap some R script/libary. And R is used to display in the stderr this kind of message:
Warning messages:
1: replacing previous import by ‘ggplot2::unit’ when loading ‘Hmisc’
2: replacing previous import by ‘ggplot2::arrow’ when loading ‘Hmisc’
3: replacing previous import by ‘scales::alpha’ when loading ‘Hmisc’
or
Error in library("foobar") : there is no package called ‘foobar’
planemo test
seems to dislike those ‘
and ’
when displaying the logs both in the stacks and in the HTML report:
======================================================================
ERROR: IPO for xcmsSet ( ipo4xcmsSet ) > Test-1
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/tmpxRw9ls/galaxy-dev/test/functional/test_toolbox.py", line 299, in test_tool
self.do_it( td )
File "/tmp/tmpxRw9ls/galaxy-dev/test/functional/test_toolbox.py", line 78, in do_it
raise e
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2018' in position 121: ordinal not in range(128)
Consequence: the test fails even if the script is processed normally and you don't know exactly what append.
For the record:
I managed to go through the first case using suppressWarnings()
:
suppressWarnings( suppressPackageStartupMessages( stopifnot( library(pkg, quietly=TRUE, logical.return=TRUE, character.only=TRUE))))
That was my feedback! Cheers
Not ideal, but you can probably workaround this shortcoming if you change your locale settings.
@bgruening @lecorguille I have the same problem with a °
character.
"'ascii' codec can't encode character u'\xb0' in position 346
@lecorguille did you manage to make planemo test with this?
I thought that my environment was good with export LANG=en_US.UTF-8
and export LC_ALL="en_US.UTF-8"
, I even try to set PYTHONIOENCODING=utf-8
without any success so far.
thank you.
I didn't meet this issue since a while. For me, I didn't change my local settings as suggested. I just worked around with the suppressWarnings things.
ok, thank you. I managed to make it works because of course you need to change the locale settings of the interface, not the locale settings of the terminal where planemo is running!