[spambayes-bugs] [ spambayes-Bugs-765242 ] UnicodeEncodeError: 'ascii' codec can't encode character '\u

SourceForge.net noreply at sourceforge.net
Sun Jul 20 19:19:15 EDT 2003


Bugs item #765242, was opened at 2003-07-03 21:09
Message generated for change (Comment added) made by mhammond
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=765242&group_id=61702

>Category: Outlook
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Bjørn Toft Madsen (sunbeam60)
>Assigned to: Mark Hammond (mhammond)
Summary: UnicodeEncodeError: 'ascii' codec can't encode character '\u

Initial Comment:
After installation, Outlook XP reports the following
error when started up:

There was an error initializing the SpamBayes addin.

Please re-start Outlook and try again.

Machine is running Danish locale, but English
installation of Office.

Log file attached.

----------------------------------------------------------------------

>Comment By: Mark Hammond (mhammond)
Date: 2003-07-21 11:19

Message:
Logged In: YES 
user_id=14198

Interesting - that exception is:

    os.environ["BAYESCUSTOMIZE"] = ini_filename

ini_filename will be a Unicode string, and in the case of
tha bug, contain non-ASCII characters.  If anyone is running
from source code, I would be very interested to know if
changing to:

 os.environ["BAYESCUSTOMIZE"] = ini_filename.encode("mbcs")

Also fixes it.  I think I will make that change here anyway
- it wont hurt pure ascii filenames, and os.environ is known
to not be unicode aware at this stage.


----------------------------------------------------------------------

Comment By: Magnus Bjornsson (mbjornsson)
Date: 2003-07-21 10:46

Message:
Logged In: YES 
user_id=826804


For me it was enough to change the default encoding to
iso-8859-1, rebuild and voilà!

For instructions how, see:
http://diveintopython.org/kgp_unicode.html

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=765242&group_id=61702



More information about the Spambayes-bugs mailing list