Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 87938 - python redhat-config-* don't work if PYTHONHOME is set
Summary: python redhat-config-* don't work if PYTHONHOME is set
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: redhat-config-kickstart
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Brent Fox
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-04-03 21:04 UTC by jmccann
Modified: 2015-01-14 23:19 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-05-21 20:42:36 UTC


Attachments (Terms of Use)

Description jmccann 2003-04-03 21:04:16 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4a) Gecko/20030401

Description of problem:
The redhat-config-* python scripts don't function if the user has set PYTHONHOME.

The redhat-config-kickstart script, for example, explicitly sets PYTHONPATH so
that if the user sets a different PYTHONPATH the script will still function.

On our systems we have a custom python version installed in /usr/local and we
use PYTHONHOME=/usr/local to translate library paths.  This breaks
redhat-config-kickstart.

I am able to solve the problem by adding the following to all the redhat python
driver scripts:
export PYTHONHOME=/usr

I think this is a pretty failsafe solution.

Is it possible to have this added officially?

Version-Release number of selected component (if applicable):
Version 8.0 through 9

How reproducible:
Always

Steps to Reproduce:
1. set PYTHONHOME to other than /usr
2. start redhat-config-kickstart

    

Actual Results:  Can't find necessary python modules.

Expected Results:  Starts up.

Additional info:

Comment 1 Brent Fox 2003-04-03 21:40:10 UTC
msw, does this make sense to add?

Comment 3 Brent Fox 2003-05-21 20:42:36 UTC
This seems to be a pretty uncommon problem, so I'm reluctant to go change all
the redhat-config tools.  Even if I make those changes, other Python apps that
do not manually export PYTHONHOME will still break.  This makes me think that
this is not the right way to solve the problem.

I am going to close this as 'wontfix' but I will reconsider if we start to see
more of these reports in the future.

Comment 4 jmccann 2003-05-21 21:01:04 UTC
Let me try to explain a bit better.  Here's the script I'm talking about:

#!/bin/sh
export PYTHONPATH=/usr/share/redhat-config-kickstart
/usr/bin/python /usr/share/redhat-config-kickstart/redhat-config-kickstart.py

One way to think about this is that PYTHONPATH and PYTHONHOME are coupled.  If
you force a specific PYTHONPATH and python version (with /usr/bin/python) you
should also reset PYTHONHOME.  Now if you did the following it would be a
different story:

#!/bin/sh
export PYTHONPATH=/usr/share/redhat-config-kickstart:${PYTHONPATH}
python /usr/share/redhat-config-kickstart/redhat-config-kickstart.py


> Even if I make those changes, other Python apps that
> do not manually export PYTHONHOME will still break.

Actually that isn't true.  Most applications don't force a specific PYTHONPATH
(or override the user's settings) and python version.  If they did then they
should reset PYTHONHOME.

It's fine if you don't want to do it but I don't think it is technically correct.

Comment 5 jmccann 2003-05-21 21:12:09 UTC
Sorry, one more thing.  As a practical matter the support cost of users being
able to hose all of the redhat-config-* tools simply by setting one enviroment
variable is large.  The risk of this patch == 0.


Note You need to log in before you can comment on or make changes to this bug.