Re: [galaxy-dev] bug 8-bit bytestrings

2011-04-01 Thread Paul-Michael Agapow
> "ProgrammingError: (ProgrammingError) You must not use 8-bit
bytestrings
> unless you use a text_factory that can interpret 8-bit bytestrings
(like
> text_factory = str). It is highly recommended that you instead just
> switch your application to Unicode strings."

I'd hazard that the easiest way to solve this problem is to explicitly
encode the url when you pass it to the other program, something like:

   myprog.pl --use-this-url #echo eightbitstr.encode('utf-8')


Paul Agapow (paul-michael.aga...@hpa.org.uk)
Bioinformatics, Centre for Infections, Health Protection Agency


-
**
The information contained in the EMail and any attachments is
confidential and intended solely and for the attention and use of
the named addressee(s). It may not be disclosed to any other person
without the express authority of the HPA, or the intended
recipient, or both. If you are not the intended recipient, you must
not disclose, copy, distribute or retain this message or any part
of it. This footnote also confirms that this EMail has been swept
for computer viruses, but please re-sweep any attachments before
opening or saving. HTTP://www.HPA.org.uk
**

___
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/


[galaxy-dev] bug 8-bit bytestrings

2011-04-01 Thread Bataillie Michiel
Hello galaxy community,

I developed a tool for galaxy which runs fine (tool does everything what it's 
supposed to do) but there's always this error that occurs when the tool has 
finished it's job. It's seems to be a bug related to python and common for 
certain python versions (I use python 2.6 for my local instance of Galaxy).

This is the error that Galaxy gives when the tool has finished his job:

"ProgrammingError: (ProgrammingError) You must not use 8-bit bytestrings unless 
you use a text_factory that can interpret 8-bit bytestrings (like text_factory 
= str). It is highly recommended that you instead just switch your application 
to Unicode strings."

One of the inputs of my tool is text (type="text"), a URL(http://...) that 
needs to be given by the user. This URL is then given to my Perl script and the 
script runs fine(does everything what it's supposed to do). It seems that 
python complains about this specific piece of input, python says that the input 
is a 8-bit bytestring and only unicode (UTF-8) strings should be used in the 
text input...

How can I get around this issue, so that python stops giving me this error?

thanks in advance
kind regards
Bataillie M.

___
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/