pycompile will use /usr/local/bin/python2.X if available and python2.X is installed.

Bug #915167 reported by Nigel Hsiung
24
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-defaults (Ubuntu)
Fix Released
Undecided
Unassigned
Natty
Fix Released
Medium
Unassigned

Bug Description

[Impact]
Anyone who has a locally built python in /usr/local as well as the Ubuntu package with the same version. This is something that Debian/Ubuntu's python approach intends to support.

[Development Fix]
This bug was fixed upstream very soon after the version of python-defaults we ended up with in natty.

[Stable Fix]
The patch is trivial, call python with an absolute path, instead of relying on $PATH.

[Text Case]

1. Install python-all
2. Build and install cpython from source
   OR
   echo -e '#!/bin/sh\nexit 1' > /usr/local/bin/python2.6
   chmod +x /usr/local/bin/python2.6
3. Install a python package such as python-beautifulsoup
Success: It works
Failure: An error while setting up python-beautifulsoup

[Regression Potential]
Patch is simple enough that I can't see any. The risk of any rebuild at all is higher than the impact of this patch.

[Original Report]
Problem installing -
sudo apt-get install linaro-image-tools

ProblemType: Package
DistroRelease: Ubuntu 11.04
Package: python-beautifulsoup 3.2.0-1
ProcVersionSignature: Ubuntu 2.6.38-11.48-generic 2.6.38.8
Uname: Linux 2.6.38-11-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Thu Jan 12 13:54:21 2012
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
PackageArchitecture: all
SourcePackage: beautifulsoup
Title: package python-beautifulsoup 3.2.0-1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Nigel Hsiung (nigelcz) wrote :
Revision history for this message
Nigel Hsiung (nigelcz) wrote :

This solution worked for me: http://ubuntuforums.org/showthread.php?t=1868190

$ pwd
/usr/local/bin
$ sudo mv python2.6 python2.6__
$ sudo dpkg --configure -a

Revision history for this message
Stefano Rivera (stefanor) wrote :

Reassigning to python-defaults, as it's a bug in pycompile. From python-defaults' changelog, it looks like this bug was fixed in 2.6.6-11:

   * pycompile:
     - --exclude now works with private dirs
     - use /usr/bin/pythonX.Y rather than pythonX.Y (to avoid /usr/local
       interpreters)

natty's python-defaults was based on 2.6.6-6.

affects: beautifulsoup (Ubuntu) → python-defaults (Ubuntu)
Changed in python-defaults (Ubuntu):
status: New → Fix Released
summary: - package python-beautifulsoup 3.2.0-1 failed to install/upgrade:
- subprocess installed post-installation script returned error exit status
- 1
+ pycompile will use /usr/local/bin/python2.6 if available and python2.6
+ isn't installed.
Revision history for this message
Stefano Rivera (stefanor) wrote : Re: pycompile will use /usr/local/bin/python2.6 if available and python2.6 isn't installed.

I can't reproduce it with only a /usr/local/bin/python2.6 , but I'm still assuming this is the right solution

Changed in python-defaults (Ubuntu Natty):
importance: Undecided → Medium
description: updated
Bryce Harrington (bryce)
description: updated
summary: - pycompile will use /usr/local/bin/python2.6 if available and python2.6
- isn't installed.
+ pycompile will use /usr/local/bin/python2.X if available and python2.X
+ is installed.
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-defaults (Ubuntu Natty):
status: New → Confirmed
Revision history for this message
Evan Broder (broder) wrote :

Uploaded to natty-proposed; unsubscribing ubuntu-sponsors

Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Nigel, or anyone else affected,

Accepted python-defaults into natty-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in python-defaults (Ubuntu Natty):
status: Confirmed → Fix Committed
tags: added: verification-needed
Revision history for this message
Stefano Rivera (stefanor) wrote :

Looks good to me.

description: updated
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-defaults - 2.7.1-0ubuntu5.1

---------------
python-defaults (2.7.1-0ubuntu5.1) natty-proposed; urgency=low

  * Backport patch from 2.6.6-11: (LP: #915167)
    - pycompile: use /usr/bin/pythonX.Y rather than pythonX.Y (to avoid
      /usr/local interpreters)
 -- Stefano Rivera <email address hidden> Wed, 15 Feb 2012 14:52:26 -0800

Changed in python-defaults (Ubuntu Natty):
status: Fix Committed → Fix Released
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.