[Spambayes] Problem building 1.0.4 under Python 2.5

Thomas Hruska thruska at cubiclesoft.com
Mon Dec 24 06:26:24 CET 2007

Thomas Hruska wrote:
> Okay, I've followed the directions in README-DEVEL.txt and the final 
> sb_tray.exe refuses to do anything.
> Python 2.5.1 w/ py2exe (latest), resourcepackage (latest), pywin32 (latest)
> InnoSetup 5.2.2
> Spambayes 1.0.4
> Modified the .iss script so it would work properly under IS 5.x.  I also 
> altered the setup_all.py script as per some website I found so it didn't 
> barf on the Outlook typelib stuff (I have Outlook 2003 but don't use it 
> and don't think I've got Outlook 2000 anywhere).  It now doesn't locate 
> any typelibs, but that's fine.
> Here's a list of things that py2exe can't find:
> ['Entrian', 'FCNTL', 'OpenSSL', '_pybsddb', 'bsddb3', 'bsddb3.dbutils', 
> 'email.Encoders', 'email.Errors', 'email.Generator', 'email.Header', 
> 'email.Iterators', 'email.MIMEAudio', 'email.MIMEBase', 
> 'email.MIMEImage', 'email.MIMEMultipart', 'email.MIMEText', 
> 'email.Message', 'email.Parser', 'email.Utils', 'email.base64MIME', 
> 'exchange', 'exchdapi', 'gdbm', 'psycopg', 'pywin.dialogs', 
> 'pywin.dialogs.list', 'resource', 'twisted.internet.app']
>  From what I've read, most of that stuff is unimportant.  However, I 
> figure the 'email.*' stuff is fairly critical and the cause of my 
> problem.  How it managed to successfully build without critical 
> components is weird.  Running sb_server.py from the command-line works 
> fine - only the py2exe-based stuff is hosed.  The website says Spambayes 
> builds the e-mail stuff with 2.2.2 and later out of the box...that would 
> include 2.5.1.
> What do I need to do to get this to build under 2.5?  I'd rather not 
> re-install Python.  It was a pain to install in the first place and 
> hosed portions of my dev. environment.  I'd rather apply a patch to some 
> file.  I found some website in a foreign language that supposedly has a 
> fix specifically for this but it didn't make a whole lot of sense:
> http://www.developpez.net/forums/showthread.php?t=348257

I've figured out the problem:  Case-sensitivity.  py2exe treats imports 
as case-sensitive and the email package in Python 2.5 changed to all 
lower-case.  However, even the email package references itself using the 
older naming scheme.

My really lame solution was to go through both the Python AND Spambayes 
directories and edit the files that referenced the old email package so 
that they use the new email package.  Only then did py2exe stop 
complaining and the final app. appear to start working properly.

Obviously a terrible long-term solution, but I'm not really going for 
long-term.  This is more along the lines of a 'mostly functional hack'.

Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.


More information about the SpamBayes mailing list