incomplete patch to curses module in python2.5

Bug #395321 reported by agent 8131 on 2009-07-03
This bug report is a duplicate of:  Bug #369203: Python2.5.4 curses.initscr() fails. Edit Remove
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
python2.5 (Ubuntu)
Undecided
Unassigned
Nominated for Jaunty by Evan Broder
Nominated for Karmic by Evan Broder
xen-3.3 (Ubuntu)
Undecided
Unassigned
Nominated for Jaunty by Evan Broder
Nominated for Karmic by Evan Broder

Bug Description

The patch debian/patches/curses-init.dpatch introduced in python2.5 2.5.4-1ubuntu4 is incomplete, as it doesn't include two imports that are necessary for the patch to work. This means that curses.initscr() errors out:

root@jaunty-test:~/src/python2.5-2.5.4# python2.5
Python 2.5.4 (r254:67916, Apr 4 2009, 17:56:17)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import curses
>>> curses.initscr()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/curses/__init__.py", line 30, in initscr
    setupterm(term=_os.environ.get("TERM", "unknown"),
NameError: global name '_os' is not defined

Related branches

Evan Broder (broder) wrote :

> File "/usr/local/bin/pygrub", line 26, in <module>

That looks like you're using your own installation of pygrub, not the one that's included in xen-utils-3.3.

As of the recently published SRU for bug #362691, both pygrub and the fsimage module are installed for python2.5.

Changed in xen-3.3 (Ubuntu):
status: New → Invalid
agent 8131 (agent-8131) wrote :

I created a version of pygrub in /usr/local/bin which I could change to python2.5 and use for debugging purposes. It was a copy of the version in /usr/bin. To make sure I have the right version I moved pygrub out of /usr/bin and did an apt-get reinstall xen-utils-3.3. This reinstalled version 3.3.0-1ubuntu9.3. I verified that pygrub was changed to python2.5 (meaning my statement about 2.6 being the default was incorrect above).

However the same results are obtained through the following:

# python2.5 /usr/bin/pygrub rawimagefile
WARNING:root:Unknown image directive quiet
WARNING:root:Unknown image directive quiet
WARNING:root:Unknown image directive quiet
WARNING:root:Unknown image directive quiet
WARNING:root:Unknown image directive quiet
Traceback (most recent call last):
  File "/usr/bin/pygrub", line 660, in <module>
    chosencfg = run_grub(file, entry, fs)
  File "/usr/bin/pygrub", line 513, in run_grub
    curses.wrapper(run_main)
  File "/usr/lib/python2.5/curses/wrapper.py", line 47, in wrapper
    stdscr.keypad(0)
UnboundLocalError: local variable 'stdscr' referenced before assignment

# python2.6 /usr/bin/pygrub rawimagefile
Traceback (most recent call last):
  File "/usr/bin/pygrub", line 26, in <module>
    import fsimage
ImportError: No module named fsimage

I am certainly open to the idea that this is some problem on my system so if someone running Xen on Ubuntu 9.04 could try these commands that would be helpful. To confirm the version of pygrub here is the md5sum:

md5sum /usr/bin/pygrub
c5af85e5f126aea39aa989ef0ffd32ec /usr/bin/pygrub

Also this is an amd64 system.

Changed in xen-3.3 (Ubuntu):
status: Invalid → New
vronp (dougjames) wrote :

I believe this is a bug. Please see http://forums.citrix.com/thread.jspa?threadID=239740&start=15&tstart=0

Look at the screen capture posted. This is also with an amd64 system.

I didn't do the test you requested but this seemed like the same problem I am experiencing.

Evan Broder (broder) wrote :

vronp: You appear to be running into a configuration issue with Xen; I'm fairly confident that it's unrelated to this bug.

I've managed to reproduce this on Jaunty. It looks like the exception you're seeing is actually being raised in an exception handling clause, so it's squashing the actual error. If you just try to run `import curses; stdscr=curses.initscr()` in a Python 2.5 shell, you get:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/curses/__init__.py", line 30, in initscr
    setupterm(term=_os.environ.get("TERM", "unknown"),
NameError: global name '_os' is not defined

This appears to be a bug in the python2.5 packaging, and not in Xen. Specifically, the patch debian/patches/curses-init.dpatch is incomplete.

Changed in xen-3.3 (Ubuntu):
status: New → Invalid
description: updated
tags: removed: server virtualization xen
summary: - pygrub broken in xen-3.3 under Ubuntu 9.04
+ incomplete patch to curses module in python2.5
Evan Broder (broder) wrote :

Here's a patch to fix the issue in python2.5. I'm not sure if I should be submitting this as a bzr branch or what, but here it is.

Felix Crux (felixc) wrote :

Marking as confirmed since there is a patch available.

Changed in python2.5 (Ubuntu):
status: New → Confirmed
tags: added: packaging
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python2.5 - 2.5.4-1ubuntu5

---------------
python2.5 (2.5.4-1ubuntu5) karmic; urgency=low

  * Fix the patch to curses to include some missing imports. (LP: #395321)

 -- Evan Broder <email address hidden> Sun, 05 Jul 2009 20:58:57 -0400

Changed in python2.5 (Ubuntu):
status: Confirmed → Fix Released
agent 8131 (agent-8131) wrote :

As this is a severe regression in Jaunty will the fixed version ever be released for Jaunty?

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

Other bug subscribers