Syntax error in python module

Bug #118771 reported by Morten Kjeldgaard
22
Affects Status Importance Assigned to Milestone
Ubuntu
Feisty
Fix Released
Low
Morten Kjeldgaard
python-biopython (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: python-biopython

I actually found the problem when installing linda, but the file belongs to the python-biopython package. I suspect it has something to do with python2.5 incompatibility. This is what I got:

Selecting previously deselected package linda.
(Reading database ... 157865 files and directories currently installed.)
Unpacking linda (from .../archives/linda_0.3.24_all.deb) ...
Setting up linda (0.3.24) ...
Compiling /var/lib/python-support/python2.5/Bio/Wise/dnal.py ...
  File "/var/lib/python-support/python2.5/Bio/Wise/dnal.py", line 5
    from __future__ import division
SyntaxError: from __future__ imports must occur at the beginning of the file

Looks like a simple fix. the biopython maintainer should take care of it and report it upstream.

Revision history for this message
Jose Blanca (jblanca) wrote :

Due to this bug biopython can't be installed.
sudo apt-get install python-biopython
Compiling /var/lib/python-support/python2.5/Bio/Wise/dnal.py ...
  File "/var/lib/python-support/python2.5/Bio/Wise/dnal.py", line 5
    from __future__ import division
SyntaxError: from __future__ imports must occur at the beginning of the file

sudo dpkg-reconfigure python-biopython
Compiling /var/lib/python-support/python2.5/Bio/Wise/dnal.py ...
  File "/var/lib/python-support/python2.5/Bio/Wise/dnal.py", line 5
    from __future__ import division
SyntaxError: from __future__ imports must occur at the beginning of the file

Revision history for this message
Morten Kjeldgaard (mok0) wrote :

Here is a patch (it's trivial). I notice the maintainer isn't using dpatch which would make it easier to apply.

UCAP (ucap)
Changed in python-biopython:
status: Unconfirmed → Confirmed
Revision history for this message
Emmet Hikory (persia) wrote :

Thank you for the patch. I have added the patch tag to draw attention from packagers. I have unsubscribed ubuntu-universe-sponsors, as this does not represent a new candidate revision (patch is not a debdiff). If a debdiff is later prepared addressing this issue, please resubscribe ubuntu-universe-sponsors to request upload.

Changed in python-biopython:
importance: Undecided → Low
Revision history for this message
Morten Kjeldgaard (mok0) wrote :

Attached is a debdiff that fixes this bug. I think. I hope.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Distribution in debian/changelog should be gutsy.
Maintainer needs to be changed per https://wiki.ubuntu.com/DebianMaintainerField and that change documented in debian/changelog. Please resubscribe UUS once you update the debdiff.

Changed in python-biopython:
status: Confirmed → Needs Info
Emmet Hikory (persia)
Changed in python-biopython:
assignee: nobody → mok0
Revision history for this message
Morten Kjeldgaard (mok0) wrote :

I see this error is popping up on the biopython mailing list too, so best get it out the door...

1) Distribution in changelog -> gutsy
2) In control: Maintainer: -> XSBC-Original-Maintainer:, new Maintainer: Ubuntu MOTU Developers.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Looks good except you shouldn't remove uploaders. I'll fix that, test build it, and upload it if it's good (it should be).

Changed in python-biopython:
assignee: mok0 → kitterman
status: Needs Info → In Progress
Revision history for this message
Scott Kitterman (kitterman) wrote :

Unfortunately it currently FTBFS for me in a Gutsy pbuilder:

 fakeroot debian/rules clean
debian/rules:7: /usr/share/dpatch/dpatch.make: No such file or directory
make: *** No rule to make target `/usr/share/dpatch/dpatch.make'. Stop.
pbuilder: Failed autobuilding of package
 -> Aborting with an error

I don't have time just now to troubleshoot your debian/rules changes. For a change as trivial as this, Ubuntu will allow you to edit the source file directly rather than patch it. Either fix the dpatch rules are back the dpatch integration out completely and modify the affected file directly.

Changed in python-biopython:
assignee: kitterman → mok0
status: In Progress → Confirmed
Revision history for this message
Ming Hua (minghua) wrote :

> debian/rules:7: /usr/share/dpatch/dpatch.make: No such file or directory

Missing build dependency on dpatch, apparently.

I agree with Scott that such a change is probably better directly made in the upstream source, rather than introducing an extra build dependency.

Revision history for this message
Morten Kjeldgaard (mok0) wrote :

This is my first bug-fix on launchpad. There are things to learn :-)

Well, I've gone back to a minimal fix: the python file in error, dnal.py, the control file and the changelog. Dpatch stuff is gone, source code fix is in the debdiff. X-ing my fingers this time...

Revision history for this message
Scott Kitterman (kitterman) wrote :

I'm looking at it.

Changed in python-biopython:
assignee: mok0 → kitterman
status: Confirmed → In Progress
Revision history for this message
Scott Kitterman (kitterman) wrote :

In debian/changelog, instead of (closes :bug number), in Ubuntu it's (LP: bug number). I fixed that.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Already fixed upstream for the Gutsy version, so rejected for Gutsy. Added a task for Feisty for an SRU.

Changed in python-biopython:
assignee: kitterman → nobody
status: In Progress → Rejected
Revision history for this message
Scott Kitterman (kitterman) wrote :

Uploaded. Please monitor the package and once it's built, follow the procedures for test described https://wiki.ubuntu.com/MOTU/SRU.

Accepted:
 OK: python-biopython_1.42-2ubuntu1.dsc
     -> Component: universe Section: python
 OK: python-biopython_1.42-2ubuntu1.diff.gz
This upload awaits approval by a distro manager

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Tue, 12 Jun 2007 10:07:22 +0000
Source: python-biopython
Binary: python-biopython-martel python-biopython-sql python-biopython
python-biopython-doc
Architecture: source
Version: 1.42-2ubuntu1
Distribution: feisty-proposed
Urgency: low
Maintainer: Ubuntu MOTU Developers <email address hidden>
Changed-By: Morten Kjeldgaard <email address hidden>
Description:
 python-biopython - Python library for bioinformatics
 python-biopython-doc - Documentation for the Biopython library
 python-biopython-martel - Flat file parser for the Biopython library
 python-biopython-sql - SQL support for the Biopython library
Launchpad-Bugs-Fixed: 118771
Changes:
 python-biopython (1.42-2ubuntu1) feisty-proposed; urgency=low
 .
   * Fixed syntax error in Bio/Wise/dnal.py; from __future__ must be first
     line in file (LP: #118771)
   * Maintainer field changed per https://wiki.ubuntu.com/DebianMaintainerField.
Files:
 3458dae1b7ccb61e2fb77551920a37a2 955 python optional
python-biopython_1.42-2ubuntu1.dsc
 927615beb894dfc80e5d315259386d9c 4410 python optional
python-biopython_1.42-2ubuntu1.diff.gz
Original-Maintainer: Philipp Benner <email address hidden>

Revision history for this message
Martin Pitt (pitti) wrote :

Accepted into feisty-proposed, please go ahead with QA testing.

Revision history for this message
Morten Kjeldgaard (mok0) wrote :

python-biopython (1.42-2ubuntu1) feisty-proposed; urgency=low

  * Fixed syntax error in Bio/Wise/dnal.py; from __future__ must be first
    line in file (LP: #118771)
  * Maintainer field changed per https://wiki.ubuntu.com/DebianMaintainerField.

 -- Morten Kjeldgaard <email address hidden> Tue, 12 Jun 2007 10:07:22 +0000

Changed in python-biopython:
status: Rejected → Fix Released
Revision history for this message
Peter (ubuntu-launchpad-maubp) wrote :

This was fixed in Biopython in December 2006 (included in Biopython 1.43)

http://cvs.biopython.org/cgi-bin/viewcvs/viewcvs.cgi/biopython/Bio/Wise/dnal.py?cvsroot=biopython

Revision history for this message
Morten Kjeldgaard (mok0) wrote : Re: [Bug 118771] Re: Syntax error in python module

Dear Peter,
> This was fixed in Biopython in December 2006 (included in Biopython
> 1.43)
>
I was assuming so. However, since version 1.43 is not due until gutsy
comes out late this year, I thought it would be good to fix the bug in
feisty. I initially thought that was going to happen once the fix was
approved, but apparently not. The bug generates an error message every
time there is something python going on during installs etc. Pretty
anoying, and perhaps confusing to the casual user.

 Can you advise me on how to proceed in order to get this in as a bug
fix in feisty?

Cheers,
Morten

--
Morten Kjeldgaard, Asc. professor, Ph.D.
Department of Molecular Biology, Aarhus University
Gustav Wieds Vej 10 C, DK-8000 Aarhus C, Denmark
Lab +45 89425026 * Mobile +45 51860147 * Fax +45 86123178
Home +45 86188180 * http://www.bioxray.dk/~mok

Revision history for this message
Scott Kitterman (kitterman) wrote :

What we need is for at least two people to install the package from feisty-proposed and comment here "works for me".

Revision history for this message
Jose Blanca (jblanca) wrote :

It works for my using feisty-proposed in amd64.
Thanks for the fix.

Revision history for this message
John Vivirito (gnomefreak) wrote :

works with feisty-proposed repo i would say go ahead and push it :) on 32bit here but shouldnt matter with that package

Revision history for this message
Martin Pitt (pitti) wrote :

Copied to feisty-updates.

Revision history for this message
Iddo Friedberg (iddo) wrote :

Seems like the bug is still there... I just tried to apt-get install biopython and the "from __future__ (etc.)" syntax error crops up again

Revision history for this message
Scott Kitterman (kitterman) wrote :

What version do you have installed?

Also exactly which file raised the error? Maybe we missed one.

Revision history for this message
Iddo Friedberg (iddo) wrote :

I have kubuntu feisty (7.04) installed, and I did an:

sudo apt-get install python-biopython

with the resulting:

Setting up python-biopython (1.42-2) ...
Compiling /var/lib/python-support/python2.5/Bio/Wise/dnal.py ...
  File "/var/lib/python-support/python2.5/Bio/Wise/dnal.py", line 5
    from __future__ import division
SyntaxError: from __future__ imports must occur at the beginning of the file

I do have feisty-updates in my sources.list file.

Thanks

Revision history for this message
Scott Kitterman (kitterman) wrote :

> Setting up python-biopython (1.42-2) ...

which is not the updated version.

http://us.archive.ubuntu.com/ubuntu/dists/feisty-updates/universe/source/Sources.gz

confirms that the update is in fact published.

Please double check your sources.list, update and try the install again.

Revision history for this message
tdn (spam-thomasdamgaard) wrote :

I can confirm this error.
I just tried to install biopython today and got the same error.
(full output from the terminal is available here: http://thomasdamgaard.dk/paste/P972.html)

I *have* run aptitude update, but I still get a broken biopython package.

Revision history for this message
Scott Kitterman (kitterman) wrote :

You are installing (per your paste) python-biopython 1.42-2.

1.42-2ubuntu1 is in feisty-updates and fixes the problem.

Either you do not have feisty-updates for universe activated in your /etc/apt/sources.list or your mirror is stale.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.