Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 315193 - mail-filter/spambayes-1.1_alpha6: sb_bnfilter.py does not start sb_bnserver.py
Summary: mail-filter/spambayes-1.1_alpha6: sb_bnfilter.py does not start sb_bnserver.py
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-14 02:55 UTC by David Bitseff
Modified: 2010-05-14 19:24 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild for import problem with python wrappers (spambayes-1.1_alpha6.ebuild,1.39 KB, text/plain)
2010-04-18 06:04 UTC, David Bitseff
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Bitseff 2010-04-14 02:55:42 UTC
The sb_bnfilter.py script installed by spambayes does not run properly.  This script should attempt to execute another script installed by the spambayes package called sb_bnserver.py, but the sb_bnfilter.py script attempts to execute a script called sb_bnserver.py-2.6-2.6 instead.

Reproducible: Always

Steps to Reproduce:
1. Install spambayes-1.1_alpha6
2. Run /usr/bin/sb_bnfilter.py
3. Notice the errors indicating that '/usr/bin/sb_bnserver.py-2.6-2.6' does not exist

Actual Results:  
> /usr/bin/sb_bnfilter.py    
Attempted to set [Storage] persistent_use_database with invalid value True (<type 'str'>)
'/usr/bin/sb_bnserver.py-2.6-2.6' does not exist
Attempted to set [Storage] persistent_use_database with invalid value True (<type 'str'>)
'/usr/bin/sb_bnserver.py-2.6-2.6' does not exist
Attempted to set [Storage] persistent_use_database with invalid value True (<type 'str'>)
'/usr/bin/sb_bnserver.py-2.6-2.6' does not exist
Attempted to set [Storage] persistent_use_database with invalid value True (<type 'str'>)
'/usr/bin/sb_bnserver.py-2.6-2.6' does not exist


Expected Results:  
These errors should not appear, and the script should execute /usr/bin/sb_bnserver.py-2.6 either by running this script directly or by using the /usr/bin/sb_bnserver.py wrapper script.

Disabling the generation of the python wrapper scripts by the ebuild also solves this problem.
Comment 1 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-04-15 03:44:05 UTC
Post the output of: emerge -ptv python:2.6
Comment 2 David Bitseff 2010-04-15 19:40:40 UTC
(In reply to comment #1)
> Post the output of: emerge -ptv python:2.6
> 

My amd64 system is maintained by paludis.  Here's the equivalent output:

These packages will be installed:

* dev-lang/python :2.6 [R 2.6.4-r1] <target>
    Reasons: sys-apps/portage-2.1.7.17:0::installed
    berkdb -build -doc -examples gdbm -ipv6 ncurses readline sqlite ssl threads -tk (wide-unicode) -wininst xml build_options: -optional_tests -split strip -trace -preserve_work                                                                                                       

Total: 1 package (1 rebuild)


The problem also exists on a x86 chroot system I have that uses portage:

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild   R   ] dev-lang/python-2.6.4-r1  USE="berkdb gdbm ncurses readline ssl threads (wide-unicode) xml -build -doc -examples -ipv6 -sqlite -tk -wininst" 0 kB                                                                                                                       

Total: 1 package (1 reinstall), Size of downloads: 0 kB
Comment 3 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-04-15 19:43:32 UTC
This problem is probably fixed in newer versions of dev-lang/python. Please test with dev-lang/python-2.6.5-r1.
Comment 4 David Bitseff 2010-04-16 01:42:42 UTC
(In reply to comment #3)
> This problem is probably fixed in newer versions of dev-lang/python. Please
> test with dev-lang/python-2.6.5-r1.
> 

The good news is that upgrading to python-2.6.5-r1 did help.  Now the sb_bnserver.py wrapper script is found by sb_bnfilter.py, and it does execv the sb_bnserver.py-2.6 script.

The bad news is that line 161 of the sb_bnserver.py-2.6 script contains the following statement which quietly fails:

from sb_filter import HammieFilter

The ebuild has made sb_filter.py into a wrapper script for sb_filter.py-2.6, so HammieFilter is no longer defined in sb_filter.py.
Comment 5 David Bitseff 2010-04-18 06:04:33 UTC
Created attachment 228239 [details]
ebuild for import problem with python wrappers

Here's my current ebuild to work around the problem with the python import statement in sb_bnserver.py-2.6.  It creates a hard link to sb_filter.py-2.6, and then the import statement is rewritten to point at the new file.
Comment 6 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-05-14 19:24:00 UTC
I added better workaround in mail-filter/spambayes-1.1_alpha6-r1.