Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 232461 - mail-filter/spambayes-1.0.4 + python 2.5 = SyntaxError: from __future__ imports must occur at the beginning of the file
Summary: mail-filter/spambayes-1.0.4 + python 2.5 = SyntaxError: from __future__ impor...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High major
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-20 11:44 UTC by Matt McHenry
Modified: 2008-07-26 02:31 UTC (History)
1 user (show)

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


Attachments
emerge --info (emerge.info,4.00 KB, text/plain)
2008-07-20 11:49 UTC, Matt McHenry
Details
Patch to fix from __future__ imports in mail-filter/spambayes-1.0.4.ebuild (spambayes-1.0.4.ebuild.patch,653 bytes, patch)
2008-07-21 05:35 UTC, Jesus Rivero (RETIRED)
Details | Diff
Patch used in mail-filter/spambayes-1.0.4.ebuild new ebuild (spambayes-1.0.4_import_errors_232461.patch,2.41 KB, patch)
2008-07-21 05:37 UTC, Jesus Rivero (RETIRED)
Details | Diff
Patch for mail-filter/spambayes-1.0.4 fixing 'from __future import' (spambayes-1.0.4_import_errors_232461.patch,2.96 KB, patch)
2008-07-26 02:16 UTC, Jesus Rivero (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt McHenry 2008-07-20 11:44:26 UTC
After upgrading to python 2.5, I get the following error:

$ sb_imapfilter.py
  File "/usr/bin/sb_imapfilter.py", line 93
    from __future__ import generators
SyntaxError: from __future__ imports must occur at the beginning of the file

Re-emerging does not help, but instead produces more similar errors:

 * Byte compiling python modules for python-2.5 .. ...
Compiling /usr/lib/python2.5/site-packages/spambayes/Corpus.py ...
  File "/usr/lib/python2.5/site-packages/spambayes/Corpus.py", line 82
    from __future__ import generators
SyntaxError: from __future__ imports must occur at the beginning of the file

Compiling /usr/lib/python2.5/site-packages/spambayes/FileCorpus.py ...
  File "/usr/lib/python2.5/site-packages/spambayes/FileCorpus.py", line 85
    from __future__ import generators
SyntaxError: from __future__ imports must occur at the beginning of the file

Compiling /usr/lib/python2.5/site-packages/spambayes/message.py ...
  File "/usr/lib/python2.5/site-packages/spambayes/message.py", line 78
    from __future__ import generators
SyntaxError: from __future__ imports must occur at the beginning of the file

Compiling /usr/lib/python2.5/site-packages/spambayes/Corpus.py ...
  File "/usr/lib/python2.5/site-packages/spambayes/Corpus.py", line 82
    from __future__ import generators
SyntaxError: from __future__ imports must occur at the beginning of the file

Compiling /usr/lib/python2.5/site-packages/spambayes/FileCorpus.py ...
  File "/usr/lib/python2.5/site-packages/spambayes/FileCorpus.py", line 85
    from __future__ import generators
SyntaxError: from __future__ imports must occur at the beginning of the file

Compiling /usr/lib/python2.5/site-packages/spambayes/message.py ...
  File "/usr/lib/python2.5/site-packages/spambayes/message.py", line 78
    from __future__ import generators
SyntaxError: from __future__ imports must occur at the beginning of the file
                                                                          [ ok ]
>>> mail-filter/spambayes-1.0.4 merged.

Reproducible: Always

Steps to Reproduce:




Upstream bug is here: https://sourceforge.net/tracker/?func=detail&atid=498103&aid=1758473&group_id=61702.  But they haven't made a release (other than alphas) that includes these changes.  Can we get a patch and include it with the 1.0.4 ebuild?
Comment 1 Matt McHenry 2008-07-20 11:49:11 UTC
Created attachment 160912 [details]
emerge --info
Comment 2 Jesus Rivero (RETIRED) gentoo-dev 2008-07-21 05:35:51 UTC
Created attachment 160977 [details, diff]
Patch to fix from __future__ imports in mail-filter/spambayes-1.0.4.ebuild

Ebuild patch for mail-filter/spambayes-1.0.4

Some ebuilds are going to suffer from this in Python2.5. At least is an easy, painless fix ;D
Comment 3 Jesus Rivero (RETIRED) gentoo-dev 2008-07-21 05:37:05 UTC
Created attachment 160979 [details, diff]
Patch used in mail-filter/spambayes-1.0.4.ebuild new ebuild

Moves from __future__ import lines to a suitable place

Best regards,
Comment 4 Jesus Rivero (RETIRED) gentoo-dev 2008-07-26 02:16:14 UTC
Created attachment 161383 [details, diff]
Patch for mail-filter/spambayes-1.0.4 fixing 'from __future import' 

I have missed scripts/sb_imapfilter.py from the list.
Comment 5 Rob Cakebread (RETIRED) gentoo-dev 2008-07-26 02:31:41 UTC
Thanks for the report, Matt, added fix to CVS.
Thanks for the patches, Jesus.