[Spambayes] A most peculair problem with SB 1

Tony Meyer tameyer at ihug.co.nz
Thu Nov 11 02:36:05 CET 2004


>> Further to this - the error that appears in the Event Log is:
[...]
>> exceptions.ImportError: dynamic module does not define init function
>> (initzlib)
> 
> Which - apart from the exceptions line at the end seems to me 
> to be similar to my original error posting.

This one I have managed to (just) fix, thanks to some help from Mark.  The
problem is that I have a zlib.dll in my system32 directory, which is ahead
of the Python DLLs directory in sys.path, and so is found first (and is not
the same DLL).  Mark hinted that he might fix up pywin32 to handle this
better, but for the moment having pop3proxy_service.py do a reorganisation
of sys.path fixes the problem.

If you want to try it, you could put this after the "import sys, os" line of
pop3proxy_service.py:

"""
for dir in sys.path[:-1]:
    if dir.lower().endswith("windows\\system32"):
        sys.path.remove(dir)
        assert dir not in sys.path, \
               "Please remove multiple copies of windows\system32 in path"
        sys.path.append(dir)
"""

> What is possibly wrong [i.e. sometimes doesn't work] is that 
[...]
> b] SB doesn't appear to be recording any debug or other logs anywhere.

I've written up a Handler to redirect messages into the event log, to avoid
this.  A patch (also include the above) is attached, if you want to try it
out.  (The patch includes a hack to avoid win32trace even if running from
source).

[The patch requires Python 2.3 or higher at the moment, but your traceback
indicated that's what you're using anyway.]

The other stuff should be going to win32trace.  If you open PythonWin and do
Tools->Trace Debugger Collecting Tool, it should appear there.  I'm not sure
how else one gets hold of it.

> I trapped the exception and it's listed below.
[...]
> error: uncaptured python exception, closing channel 
> <sb_server.BayesProxy 
> connected 192.168.0.50:3142 at 0xdb5ad0> 
> (socket.error:(10053, 'Software 
> caused connection abort') 
> [C:\Python23\lib\asynchat.py|handle_read|88] 
> [C:\Python23\Scripts\sb_server.py|recv|397] 
> [C:\Python23\lib\asyncore.py|recv|356])

I hate this error - it gets thrown up when all sorts of things happen.  The
most likely one is that the socket that was connected died unexpectedly, but
I don't see how that would be the case here.

If you can, try the patch to get it working outside of debug mode, and see
if the same error occurs (it ought to correctly go to the event log, even
without the other patch since it's an exception).

> Hope this is helping

Yup, thanks :)

=Tony.Meyer

-- 
Please always include the list (spambayes at python.org) in your replies
(reply-all), and please don't send me personal mail about SpamBayes.
http://www.massey.ac.nz/~tameyer/writing/reply_all.html explains this.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pop3proxy_service.py.diff
Type: application/octet-stream
Size: 5800 bytes
Desc: not available
Url : http://mail.python.org/pipermail/spambayes/attachments/20041111/f681f384/pop3proxy_service.py-0001.obj


More information about the Spambayes mailing list