byobu 5.25 not working in Python 2.6

Bug #1098102 reported by Martin Luder
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
byobu
Fix Released
High
Unassigned

Bug Description

I use the byobu PPA on lucid. I installed byobu 5.25 tonight (upgrade from 5.22) and now byobu does not work anymore:

$ byobu
Traceback (most recent call last):
  File "/usr/bin/byobu-select-session", line 90, in <module>
    sessions = get_sessions()
  File "/usr/bin/byobu-select-session", line 56, in get_sessions
    output = subprocess.check_output(["tmux", "list-sessions"])
AttributeError: 'module' object has no attribute 'check_output'

According to http://docs.python.org/2/library/subprocess.html#subprocess.check_output check_output was added in Python 2.7, but lucid ships with 2.6.

Revision history for this message
Martin Luder (maser) wrote :

I have just installed 5.24 and it still works with Python 2.6.

Revision history for this message
Daniel Hahler (blueyed) wrote :

Confirming.

The problem appears when using tmux and there is a tmux session already running.

Changed in byobu:
status: New → Confirmed
Revision history for this message
Martin Luder (maser) wrote :

Still happens in 5.26.

Revision history for this message
Jorge E. Gómez (jorgeegomez) wrote :

@Daniel: I have the same problem, and I'm using the screen backend.

Revision history for this message
Jorge E. Gómez (jorgeegomez) wrote :

I confirm the problem occurs on a Lucid server (python 2.6.5) with Byobu 5.26, both with the tmux and screen backends.

Steps to reproduce:
* Run byobu-screen
* Dettach from session (press F6)
* Try running byobu-screen again

Expected result:
* Attach to Byobu / screen session

Actual result:
* Error message ending in "AttributeError: 'module' object has no attribute 'check_output'"

Temporary workaround:
* Run "byobu-screen -r" to manually indicate re-attach, and bypass subprocess checking

Revision history for this message
Marcio Merlone (mmerlone) wrote :

Traceback (most recent call last):
  File "/usr/bin/byobu-select-session", line 97, in <module>
    sessions = get_sessions()
  File "/usr/bin/byobu-select-session", line 63, in get_sessions
    output = subprocess.check_output(["tmux", "list-sessions"])
AttributeError: 'module' object has no attribute 'check_output'
Traceback (most recent call last):
  File "/usr/bin/byobu-select-session", line 97, in <module>
    sessions = get_sessions()
  File "/usr/bin/byobu-select-session", line 63, in get_sessions
    output = subprocess.check_output(["tmux", "list-sessions"])
AttributeError: 'module' object has no attribute 'check_output'

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Confirmed. Fixing now :-(

Changed in byobu:
importance: Undecided → High
status: Confirmed → In Progress
status: In Progress → Fix Committed
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Committed revision 2016.

Changed in byobu:
status: Fix Committed → Fix Released
Revision history for this message
Martin Luder (maser) wrote :

Thanks Dustin!

Was the fix included in 5.27? Because i still get the same error:

:~$ byobu -v
byobu version 5.27
tmux 1.5
:~$ byobu
Traceback (most recent call last):
  File "/usr/bin/byobu-select-session", line 97, in <module>
    sessions = get_sessions()
  File "/usr/bin/byobu-select-session", line 63, in get_sessions
    output = subprocess.check_output(["tmux", "list-sessions"])
AttributeError: 'module' object has no attribute 'check_output'

Revision history for this message
Marcio Merlone (mmerlone) wrote :

Still error for me too:

marcio.merlone@phobos:~$ byobu
Traceback (most recent call last):
  File "/usr/bin/byobu-select-session", line 97, in <module>
    sessions = get_sessions()
  File "/usr/bin/byobu-select-session", line 63, in get_sessions
    output = subprocess.check_output(["tmux", "list-sessions"])
AttributeError: 'module' object has no attribute 'check_output'
marcio.merlone@phobos:~$ byobu -v
byobu version 5.27
tmux 1.5
marcio.merlone@phobos:~$ grep CODENAME /etc/lsb-release
DISTRIB_CODENAME=lucid
marcio.merlone@phobos:~$ uname -a
Linux phobos 2.6.32-45-server #101-Ubuntu SMP Mon Dec 3 15:54:27 UTC 2012 x86_64 GNU/Linux
marcio.merlone@phobos:~$

Revision history for this message
Marcio Merlone (mmerlone) wrote :

Forgot to mention: killed previous tmux sessions and started a new one after upgrade. Detached by ctrl+a+a, and reattached to get the error.

Revision history for this message
Marcio Merlone (mmerlone) wrote :

As a workaround I managed to install python2.7 from this ppa (1) but apps are still using python2.6. Could not issue update-alternatives --config python, it says there is no alternative for python. If I try to uninstall python2.6 it breaks a lot of dependencies, not good.

Now what? Any ideas?

(1) https://launchpad.net/~pythoneers/+archive/lts

Revision history for this message
Martin Luder (maser) wrote :

I just installed byobu 5.24 on all servers: https://launchpad.net/~byobu/+archive/ppa/+files/byobu_5.24-0ubuntu1~lucid_all.deb

What is the next step for this bug, though? I’ll just reopen.

Changed in byobu:
status: Fix Released → In Progress
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Ah, okay, I think I have it fixed now. Sorry about that! Please reopen if you can still reproduce in 5.29.

Committed revision 2035.

Changed in byobu:
status: In Progress → Fix Committed
Revision history for this message
Martin Luder (maser) wrote :

Thanks Dustin, I can confirm that 5.29 works!

Revision history for this message
Marcio Merlone (mmerlone) wrote :

Yes, fixed, it works on Lucid 10.04. Thank you.

Revision history for this message
Nicolas (nicolas-hoeft) wrote :

Could you please also change

#!/usr/bin/python

to

#!/bin/env python

especially when using a local install of python, this hard-coded location leads to unexpected errors

Revision history for this message
Daniel Hahler (blueyed) wrote :

@Nicolas: I have this requested some time ago already, too (Bug #996559).

I am re-opening it and adding a comment to use "env" in the source, but a fixed python path when installing it for distributions.
Please point any further comments in this regard at the bug mentioned above.

Changed in byobu:
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.