Hi, I'm having an UnicodeEncodeError, something like: "UnicodeEncodeError: 'ascii' codec can't encode characters in position 28-29: ordinal not in range(128)" on print or wikipedia.output() statments when running scripts submitted on submit@ with qcronsub. Some time ago I've asked for help on irc, and was told that was an undocumented error, and pointed a solution, because has far as i remember, my LC_ALL wasn't defined. I now have set upt qcronsub to run the following sh script:
#! /bin/sh
LC_ALL="en_US.UTF-8" /usr/bin/python /home/alchimista/aleph/avbot.py -botnick:'Aleph Bot' -ownernick:Alchimista -newbie:100 > /dev/null
It worked for some weeks, but now is back again. How can i fix it?
Can we get a example line?
On Tuesday, April 3, 2012, Alchimista alchimistawp@gmail.com wrote:
Hi, I'm having an UnicodeEncodeError, something like: "UnicodeEncodeError:
'ascii' codec can't encode characters in position 28-29: ordinal not in range(128)" on print or wikipedia.output() statments when running scripts submitted on submit@ with qcronsub. Some time ago I've asked for help on irc, and was told that was an undocumented error, and pointed a solution, because has far as i remember, my LC_ALL wasn't defined. I now have set upt qcronsub to run the following sh script:
#! /bin/sh
LC_ALL="en_US.UTF-8" /usr/bin/python /home/alchimista/aleph/avbot.py
-botnick:'Aleph Bot' -ownernick:Alchimista -newbie:100 > /dev/null
It worked for some weeks, but now is back again. How can i fix it?
Alchimista http://pt.wikipedia.org/wiki/Utilizador:Alchimista
I've had this error before and is most likely because your asking it to print to the console some non-english/european letter which is not in the ASCII database. My simple solution was to tell the program if it received a UnicodeEncodeError to just print that it can't display said line. (or you could just remove the print statement).
DeltaQuad English Wikipedia Administrator
On 03/04/2012 18:52, Alchimista wrote:
Hi, I'm having an UnicodeEncodeError, something like: "UnicodeEncodeError: 'ascii' codec can't encode characters in position 28-29: ordinal not in range(128)" on print or wikipedia.output() statments when running scripts submitted on submit@ with qcronsub. Some time ago I've asked for help on irc, and was told that was an undocumented error, and pointed a solution, because has far as i remember, my LC_ALL wasn't defined. I now have set upt qcronsub to run the following sh script:
#! /bin/sh
LC_ALL="en_US.UTF-8" /usr/bin/python /home/alchimista/aleph/avbot.py -botnick:'Aleph Bot' -ownernick:Alchimista -newbie:100 > /dev/null
It worked for some weeks, but now is back again. How can i fix it?
Alchimista http://pt.wikipedia.org/wiki/Utilizador:Alchimista
Toolserver-l mailing list (Toolserver-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/toolserver-l Posting guidelines for this list: https://wiki.toolserver.org/view/Mailing_list_etiquette
On 4 April 2012 00:52, Alchimista alchimistawp@gmail.com wrote:
I'm having an UnicodeEncodeError, something like: "UnicodeEncodeError: 'ascii' codec can't encode characters in position 28-29: ordinal not in range(128)" on print or wikipedia.output() statments when running scripts submitted on submit@ with qcronsub.
This should never happen. With pwb, the 'worst' that should happen is that all non-ASCII characters get replaced with question marks Could you post a bug report to the pywikipedia bug tracker [1], with the full stack trace?
Best, Merlijn
[1] http://sourceforge.net/tracker/?group_id=93107&atid=603138
This error is happening just when the script is running from submit@, and the errors are when printing things like "Absolutismo português" ( error comes from the "ê", or "Política do café com leite", with the error on the "é"). The script i'm using is a fork of http://code.google.com/p/avbot/source/browse/#svn%2Ftrunk , with some minor changes, wich doesn't afect this parts. I'll writte then a bug on pypb, thanks for the help.
Alchimista
No dia 4 de Abril de 2012 09:16, Merlijn van Deen valhallasw@arctus.nlescreveu:
On 4 April 2012 00:52, Alchimista alchimistawp@gmail.com wrote:
I'm having an UnicodeEncodeError, something like: "UnicodeEncodeError: 'ascii' codec can't encode characters in position 28-29: ordinal not in range(128)" on print or wikipedia.output() statments when running scripts submitted on submit@ with qcronsub.
This should never happen. With pwb, the 'worst' that should happen is that all non-ASCII characters get replaced with question marks Could you post a bug report to the pywikipedia bug tracker [1], with the full stack trace?
Best, Merlijn
[1] http://sourceforge.net/tracker/?group_id=93107&atid=603138
Toolserver-l mailing list (Toolserver-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/toolserver-l Posting guidelines for this list: https://wiki.toolserver.org/view/Mailing_list_etiquette
Alchimista alchimistawp@gmail.com wrote:
--===============3939809116357976354== Content-Type: multipart/alternative; boundary=047d7b10c899326f7d04bcce2a8b
--047d7b10c899326f7d04bcce2a8b Content-Type: text/plain; charset=UTF-8
Hi, I'm having an UnicodeEncodeError, something like: "UnicodeEncodeError: 'ascii' codec can't encode characters in position 28-29: ordinal not in range(128)" on print or wikipedia.output() statments when running scripts submitted on submit@ with qcronsub. Some time ago I've asked for help on irc, and was told that was an undocumented error, and pointed a solution, because has far as i remember, my LC_ALL wasn't defined. I now have set upt qcronsub to run the following sh script:
#! /bin/sh
LC_ALL="en_US.UTF-8" /usr/bin/python /home/alchimista/aleph/avbot.py -botnick:'Aleph Bot' -ownernick:Alchimista -newbie:100 > /dev/null
It worked for some weeks, but now is back again. How can i fix it?
Can you try this:
PYTHONIOENCODING=utf_8 /usr/bin/python /home/alchimista/aleph/avbot.py -botnick:'Aleph Bot' -ownernick:Alchimista -newbie:100 > /dev/null
//Saper
toolserver-l@lists.wikimedia.org