[Spambayes] first experiments - "UnicodeDecodeError" problem in Czech setup

Erik Piper erik at sky.cz
Sun Jul 6 15:18:04 EDT 2003


Hello all,

Well, these will be pretty faltering steps, but here goes...

All experiments run on Windows 2000, with EN/US regional settings. For
simplicity's sake, I'll stick to one machine from now on while examining
this issue, and only test on the other (workplace) Win98SE machine if any
solution we find doesn't work immediately there.. IMPORTANT NOTE: the
behavior in Win2K is, as stated before, a bit different than in Win98SE.
Here's my logfile from this morning:

Error connecting to Outlook!
Traceback (most recent call last):
  File "out1.pyz/addin", line 800, in OnConnection
  File "out1.pyz/manager", line 682, in GetManager
  File "out1.pyz/manager", line 229, in __init__
  File "out1.pyz/manager", line 75, in import_core_spambayes_stuff
  File "out1.pyz/os", line 414, in __setitem__
UnicodeEncodeError: 'ascii' codec can't encode character '\ued' in position
52: ordinal not in range(128)
ERROR: 'There was an error initializing the SpamBayes addin\r\n\r\nPlease
re-start Outlook and try again.'
Traceback (most recent call last):
  File "out1.pyz/addin", line 800, in OnConnection
  File "out1.pyz/manager", line 682, in GetManager
  File "out1.pyz/manager", line 229, in __init__
  File "out1.pyz/manager", line 75, in import_core_spambayes_stuff
  File "out1.pyz/os", line 414, in __setitem__
UnicodeEncodeError: 'ascii' codec can't encode character '\ued' in position
52: ordinal not in range(128)

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

> First, if execute the Python interpreter from a DOS shell what is your
default encoding (I suspect ascii):

>    import sys
>    print sys.getdefaultencoding()

The result was "ascii".

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

> In Outlook2000/manager.py...

I'm afraid you've confused me a bit here -- I only could find such a file
named manager.py in the spambayes-1.0a3.zip package located on SourceForge.
Installing version 003 didn't put it on my machine. Are you assuming that
I'm running from that SourceForge package? If so, I'll need instructions on
how to install from that.

------------------
[request for the following test]
> >>> f=unicode("c:\\@test-\xe0\xf2", "latin-1")
> >>> os.path.join(f, "foo")
> u'c:\\@test-\xe0\xf2\\foo'

Sorry, but I've never laid my fingers on python (and for all practical
purposes haven't laid my fingers on ANY programming language) before, and I
couldn't get the above to work in any useful way. The interpreter reacts
like this:

>>> f=unicode("c:\\@test-\xe0\xf2", "latin-1")
>>> os.path.join(f, "foo")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
NameError: name 'os' is not defined

# I went on to try:

>>> ntpath.join(f, "foo")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
NameError: name 'ntpath' is not defined

I'm an intelligent guy and I've been steeped in the computing environment
(as a localization tester and a tech support guy) for years, and so
hopefully I'll be able to figure out any instructions I'm given. However,
don't take too much for granted regarding my knowledge.

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

Incidentally, in regard to Skip's note:

> If your system has filenames which contain non-ASCII characters I suspect
your system's default encoding needs to be set properly in
c:\Python23\site.py

...there's no such file in my c:\Python23 folder.

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

As soon as I get some more clarifying information, I'll continue with the
experiments.

Erik




More information about the Spambayes mailing list