[patch] bad interpreter (python 2.4) given for pygtk-demo

Bug #221007 reported by Pietro Battiston
6
Affects Status Importance Assigned to Milestone
pygtk (Debian)
Fix Released
Unknown
pygtk (Ubuntu)
Fix Released
Undecided
Pietro Battiston

Bug Description

Binary package hint: python-gtk2-doc

Under Hardy (rc updated daily), I installed the package python-gtk2-doc and ran "pygtk-demo"; I got the following:

  bash: /usr/bin/pygtk-demo: /usr/bin/python2.4: bad interpreter: No such file or directory

Right, I don't have python2.4 installed. So - one would say - it is a missing dependency.

I don't think so, since just giving the command "python /usr/bin/pygtk-demo" works flawlessy, so 2.4 is just not needed. So the problem is just in the first line, "#! /usr/bin/python2.4", which should (maybe, I'm no expert) be changed to "#! /usr/bin/python" (assuming we have no more old pythons around).

Tags: patch

Related branches

Revision history for this message
Gian Mario Tagliaretti (gianmt) wrote :

same here

gianmt@urano:~$ pygtk-demo
bash: /usr/bin/pygtk-demo: /usr/bin/python2.4: bad interpreter: No such file or directory

Revision history for this message
Gian Mario Tagliaretti (gianmt) wrote :

ping on this one? nobody can use pygtk-demo which is a quite useful resurce

Revision history for this message
Pietro Battiston (toobaz) wrote :

Actually, it's not totally clear to me what kind of patch I'm supposed to supply. This is a patch just needing to be saved in debian/patches before building...

Revision history for this message
Pietro Battiston (toobaz) wrote :

while this is a patch against all debian folder (which includes file mentioned above in debian/patches), see https://wiki.ubuntu.com/MOTU/Contributing

both patches in the end do the same: they just modify the first line of examples/pygtk-demo/pygtk-demo.in .

This may be a not really clean fix, but certainly works.

Changed in python-gtk2-doc:
status: New → Confirmed
Revision history for this message
Pietro Battiston (toobaz) wrote :

(actually, I forgot to mention the fact that this bug is still present in Intrepid, updated daily)

Revision history for this message
Pietro Battiston (toobaz) wrote :

Attaching debdiff for pygtk-2.13.0-0ubuntu3, which solves the bug. Please review...

Revision history for this message
Pietro Battiston (toobaz) wrote :

Please review _this_ debdiff (in the previous, I forgot to mention the to-be-closed bug).

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

Pietro, I don't quite understand this. python2.4 is not at all hardcoded into examples/pygtk-demo/pygtk-demo.in, it uses @PYTHON@. So I guess the code that replaces it with the real python is broken and uses 2.4 instead of 2.5. IMHO it would be better to fix that than to replace it with another hack (env python is bad as well, should usually jus be /usr/bin/python if it works with any version).

Changed in python-gtk2-doc:
assignee: nobody → toobaz
Revision history for this message
Pietro Battiston (toobaz) wrote :

Thank you very much for your answer.

By "hardcoded" I meant that it is in the binary package's python script, not obviously in the source.

Since the package has python 2.4 in build-depends (and that @PYTHON@ seems to mean preferably python2.4), it necessary happens every time the package is compiled. Anyway, I removed the "hardcoded" word from the changelog, to kill any ambiguity.

Since my experience is quite poor in python packaging, I did had some doubts on the "cleanness" of the patch, and I thank you for pointing that "env python" is bad, I didn't know. However:
- my patch does fix in a reliable way a package that has a _big_ bug that renders it inusable (since Gutsy, if I recall correctly!)
- I frankly don't know much about makefiles and absolutely have not time now to learn. If this is possible to send this perfectly working hack to Intrepid, I can work on a cleaner fix for Intrepid+1
- I think that your idea of modifying the build process seems cleaner because it can be sent to upstream as a patch, but I'm not totally sure notifying upstream has any sense. The build process ensures python 2.4 is there before hardcoding it; it's an Ubuntu (/Debian) problem if you compile with python 2.4 present and then you want to run it without. It's a guess, please tell me if I'm wrong (I mean: if "/usr/python2.4" in a python script is bad by itself).

Anyway, the patch I'm uploading replaces "env python" "python" and removes the "hardcoded" word from the changelog. I really hope this is OK, because a such simple but important bug not fixed along 3 releases would be something quite ridiculous.

If someone else can do now something better, perfect.

Revision history for this message
Pietro Battiston (toobaz) wrote :

Sorry, I had not noticed that, while waiting, another Ubuntu pygtk version was out, so I debdiffed against the old one.

I'm now attaching a new debdiff.

(and sorry if my words in the previous post sound harsh, it wasn't my intention; as you, I prefer a clean fix to a hack, but I also prefer a hack to a bug)

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

Pietro, thanks, that looks ok. I didn't mean to be harsh, just explaining that we can't/shouldn't just fix stuff in Ubuntu and sit on the patches forever. Thus we *need* to find solutions which are generic enough to be palatable for our upstreams (debian and the original authors), otherwise we'll just drown in our patches and can't do anything else any more than to keep porting them to new releases. At the very least we should create a Debian bug and send the patch there.

For aspiring Ubuntu developers I'd expect them to learn how to do this themselves, but I take it that this just was a "drive-by patch" and you don't want to be bothered with learning all the workflows around it. I'll send it to Debian myself then.

Uploaded, thank you!

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

pygtk (2.13.0-0ubuntu4) intrepid; urgency=low

  * Remove reference to python 2.4 in pygtk-demo (LP: #221007).

 -- Pietro Battiston < <email address hidden>> Tue, 23 Sep 2008 14:46:12 +0200

Changed in python-gtk2-doc:
status: Confirmed → Fix Released
Changed in pygtk:
status: Unknown → Fix Committed
Changed in pygtk (Debian):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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