This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Orlowski
Recipients Orlowski
Date 2009-09-03.09:29:53
SpamBayes Score 3.3733183e-11
Marked as misclassified No
Message-id <1251970195.88.0.252657466377.issue6832@psf.upfronthosting.co.za>
In-reply-to
Content
Hi

When I am outputting unicode strings to terminal my script works OK, but
when I redirect it to file I get a crash:

$ python mailing/message_sender.py -l Bia
Białystok

$ python mailing/message_sender.py -l Bia > ~/tmp/aaa.txt 
Traceback (most recent call last):
  File "mailing/message_sender.py", line 71, in <module>
    list_groups(unicode(args[0],'utf-8'))
  File "mailing/message_sender.py", line 53, in list_groups
    print group[1].name
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0142' in
position 3: ordinal not in range(128)
History
Date User Action Args
2009-09-03 09:29:55Orlowskisetrecipients: + Orlowski
2009-09-03 09:29:55Orlowskisetmessageid: <1251970195.88.0.252657466377.issue6832@psf.upfronthosting.co.za>
2009-09-03 09:29:54Orlowskilinkissue6832 messages
2009-09-03 09:29:54Orlowskicreate