Python upgrade breaks eyeD3

Bug #307345 reported by Tim Heaney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
eyed3 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: eyed3

I built Python 2.6.1 from source and installed it in /usr/local/bin/python. The original Python is still in /usr/bin/python.

  tim@calvin:~$ /usr/bin/python -V
  Python 2.5.2
  tim@calvin:~$ /usr/local/bin/python -V
  Python 2.6.1

This broke the eyeD3 command-line program, which failed with

  tim@calvin:~/Music/JuneStar$ eyeD3 released.mp3
  Traceback (most recent call last):
    File "/usr/bin/eyeD3", line 32, in <module>
      from eyeD3 import *;
  ImportError: No module named eyeD3

That's because /usr/bin/eyeD3 has a shebang line of

  #!/usr/bin/env python

and, of course, that's now finding the wrong version of Python

  tim@calvin:~$ /usr/bin/env python -V
  Python 2.6.1

Calling with the correct version of Python fixes it.

  tim@calvin:~/Music/JuneStar$ /usr/bin/python /usr/bin/eyeD3 released.mp3

  released.mp3 [ 4.21 MB ]
  -------------------------------------------------------------------------------
  Time: 04:36 MPEG1, Layer III [ 128 kb/s @ 44100 Hz - Joint stereo ]
  -------------------------------------------------------------------------------
  ID3 v2.3:
  title: Released artist: Andrew Grimm
  album: Recordings year: None
  track: genre: Folk (id 80)

Thus changing the shebang line of /usr/bin/eyeD3 to /usr/bin/python fixes it.

This is essentially the same issue as #199134

  https://bugs.launchpad.net/system-tools-backends/+bug/199134

but not as severe, since it's an user application that is broken, rather than a system tool. And it's a matter of missing dependencies, not a broken interpreter as freedesktop.org so unkindly summarized the upstream version of that bug

  http://bugs.freedesktop.org/show_bug.cgi?id=16642;

I reported this issue to the developer of eyeD3 back in October when it first happened to me (with Python 2.6, not 2.6.1), but I could not seem to convince him that it's a mistake to use env this way in system scripts.

But it's not really an issue with eyeD3 per se, but with the .deb that installs it. Shouldn't it re-write the shebang line to /usr/bin/python? Indeed, on my system all of the following are bugs waiting to happen:

  /usr/bin/getnonfreefonts #!/usr/bin/env perl
  /usr/bin/getnonfreefonts-sys #!/usr/bin/env perl
  /usr/bin/gtk-builder-convert #!/usr/bin/env python
  /usr/bin/gtkcdlabel.py #!/usr/bin/env python
  /usr/bin/hp-align #!/usr/bin/env python
  /usr/bin/hp-check #!/usr/bin/env python
  /usr/bin/hp-clean #!/usr/bin/env python
  /usr/bin/hp-colorcal #!/usr/bin/env python
  /usr/bin/hp-fab #!/usr/bin/env python
  /usr/bin/hp-firmware #!/usr/bin/env python
  /usr/bin/hp-info #!/usr/bin/env python
  /usr/bin/hp-levels #!/usr/bin/env python
  /usr/bin/hp-makecopies #!/usr/bin/env python
  /usr/bin/hp-makeuri #!/usr/bin/env python
  /usr/bin/hp-print #!/usr/bin/env python
  /usr/bin/hp-probe #!/usr/bin/env python
  /usr/bin/hp-scan #!/usr/bin/env python
  /usr/bin/hp-sendfax #!/usr/bin/env python
  /usr/bin/hp-setup #!/usr/bin/env python
  /usr/bin/hp-systray #!/usr/bin/env python
  /usr/bin/hp-testpage #!/usr/bin/env python
  /usr/bin/hp-timedate #!/usr/bin/env python
  /usr/bin/hp-toolbox #!/usr/bin/env python
  /usr/bin/hp-unload #!/usr/bin/env python
  /usr/bin/invest-chart #!/usr/bin/env python
  /usr/bin/perltex #! /usr/bin/env perl
  /usr/bin/rss-glx_install #!/usr/bin/env perl
  /usr/bin/texdoctk #!/usr/bin/env perl
  /usr/bin/tomboy #!/usr/bin/env bash
  /usr/bin/tomboy-panel #!/usr/bin/env bash

In fact, I guess in my case, the Python ones have already happened. Let's see

  tim@calvin:~$ /usr/bin/gtkcdlabel.py
  python-id3 not found - diabling MP3/ID3 support
  python-cddb not found - diabling CDDB support

Yup, Gtkcdlabel is now broken for the same reason (missing dependencies).

The Debian developers *prefer* /usr/bin/python and *advise* against /usr/bin/env

  http://www.debian.org/doc/packaging-manuals/python-policy/ch-python.html#s-interpreter_loc

Perhaps I should lobby them for stronger terms.

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 8.10
Package: eyed3 0.6.16 [modified: usr/bin/eyeD3]
PackageArchitecture: all
ProcEnviron:
 PATH=/home/username/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/username/bin:/home/username/sh:/home/username/perl:/home/username/python:/home/username/ruby:.
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: eyed3
Uname: Linux 2.6.27-9-generic x86_64

Tags: apport-bug
Revision history for this message
Tim Heaney (theaney) wrote :
Revision history for this message
Alexandre Detiste (alexandre-detiste) wrote :

please try again with the last version that uses python3

Revision history for this message
Tim Heaney (theaney) wrote :

Yup, works great! Thanks!

$ eyeD3
The program 'eyeD3' is currently not installed. You can install it by typing:
sudo apt install eyed3

$ sudo apt install eyed3
...

$ which eyeD3
/usr/bin/eyeD3

$ head -1 /usr/bin/eyeD3
#!/usr/bin/python

$ eyeD3 RebelBlues.mp3
/home/tim/Music/SulRebel/RebelBlues.mp3 [ 3.81 MB ]
-------------------------------------------------------------------------------
Time: 02:05 MPEG1, Layer III [ 256 kb/s @ 44100 Hz - Stereo ]
-------------------------------------------------------------------------------
ID3 v2.4:
title: Rebel Blues
artist: Sul Rebel
album:
album artist: Sul Rebel
recording date: 2012-07-13T15:38:11
track: 0 genre: Blues (id 0)
Comment: [Description: ] [Lang: eng]
URL: http://freemusicarchive.org/music/Sul_Rebel/~/RebelBlues
Comments: http://freemusicarchive.org/
Curators: ccCommunity, Music for Video
Copyright: Creative Commons Attribution-NonCommercial-NoDerivatives (aka Music Sharing): http://creativecommons.org/licenses/by-nc-nd/3.0/
-------------------------------------------------------------------------------

$ which python
/home/tim/.pyenv/shims/python

Pander (pander)
Changed in eyed3 (Ubuntu):
status: New → 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.