[Spambayes] FW: Windows 7 x64 - Problems
Ocean
Ocean at cobaltnight.com
Thu Jan 7 01:33:19 CET 2010
> -----Original Message-----
> From: Mark Hammond [mailto:mhammond at skippinet.com.au]
> Sent: Wednesday, January 06, 2010 6:53 PM
> To: Ocean
> Cc: spambayes at python.org
> Subject: Re: [Spambayes] FW: Windows 7 x64 - Problems
>
> On 7/01/2010 12:54 AM, Ocean wrote:
> > The only relevant section I could find was in addin.py. I made the
> > appropriate modifications (commenting out "import win32traceutil" and
> > copying the body of the IF statement above it in it's place),
unregistered
> > the addin, and re-registered it - but that didn't seem to do the trick.
>
> That should be right - or just change the line:
>
> if hasattr(sys, "frozen"):
>
> to something like:
>
> if True or hasattr(sys, "frozen"):
>
> Also, ensure you don't register the addin with '--debug'
>
> HTH,
>
> Mark
That's exactly what I did. Here's the exact code I used:
--------------------------------------------------
# No console - if we are running from Python sources,
# redirect to win32traceutil, but if running from a binary
# install, redirect to a log file.
# Want to move to logging module later, so for now, we
# hack together a simple logging strategy.
if hasattr(sys, "frozen"):
temp_dir = win32api.GetTempPath()
for i in range(3,0,-1):
try: os.unlink(os.path.join(temp_dir, "spambayes%d.log" %
(i+1)))
except os.error: pass
try:
os.rename(
os.path.join(temp_dir, "spambayes%d.log" % i),
os.path.join(temp_dir, "spambayes%d.log" % (i+1))
)
except os.error: pass
# Open this log, as unbuffered so crashes still get written.
sys.stdout = open(os.path.join(temp_dir,"spambayes1.log"), "wt", 0)
sys.stderr = sys.stdout
else:
# Enable Log Files when running from source
temp_dir = win32api.GetTempPath()
for i in range(3,0,-1):
try: os.unlink(os.path.join(temp_dir, "spambayes%d.log" %
(i+1)))
except os.error: pass
try:
os.rename(
os.path.join(temp_dir, "spambayes%d.log" % i),
os.path.join(temp_dir, "spambayes%d.log" % (i+1))
)
except os.error: pass
# Open this log, as unbuffered so crashes still get written.
sys.stdout = open(os.path.join(temp_dir,"spambayes1.log"), "wt", 0)
sys.stderr = sys.stdout
# Rem out original line in this section
# import win32traceutil
# End of Enable Log Files when running from source
--------------------------------------------------
I unregistered with "addin.py --unregister", and I registered with
"addin.py". No go.
More information about the SpamBayes
mailing list