Bug 149809 - python path does not contain /usr/local
Summary: python path does not contain /usr/local
Status: RESOLVED FIXED
: 149843 (view as bug list)
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Final
Hardware: x86-64 SuSE Linux 10.0
: P5 - None : Normal
Target Milestone: ---
Assignee: Jan Matejek
QA Contact: E-mail List
URL:
Whiteboard:
Keywords: Bad_Design
Depends on:
Blocks:
 
Reported: 2006-02-09 23:37 UTC by Karl Pietrzak
Modified: 2006-02-28 16:57 UTC (History)
0 users

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Pietrzak 2006-02-09 23:37:14 UTC
On my SuSE 10.0 x86_64 box, the python paths are as follows:

# python -c 'import sys; print sys.path'
['', '/usr/lib/python24.zip', '/usr/lib64/python2.4', '/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk', '/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages', '/usr/lib64/python2.4/site-packages/Numeric', '/usr/lib64/python2.4/site-packages/PIL', '/usr/lib64/python2.4/site-packages/setuptools-0.6a9-py2.4.egg', '/usr/lib64/python2.4/site-packages/gtk-2.0', '/usr/lib64/python2.4/site-packages/wx-2.6-gtk2-unicode']
#

Note the lack of anything that starts with /usr/local.  At the very least, /usr/local/lib64/python2.4/site-packages/ should be in that list, for the same reasons that $PATH contains /usr/local/bin $XDG_CONFIG_DIRS contains /usr/local/etc/xdg/.  Among other reasons, /usr may be marked read-only, as per the FHS.

I'm sure this applies to 10.1 as well.
Comment 1 Karl Pietrzak 2006-02-16 19:00:26 UTC
At first, I thought this was a Python bug.

http://sourceforge.net/tracker/?group_id=5470&atid=105470&func=detail&aid=1428789

The response from the Python devs led me to post it here.

Apparently by default Python already contains /usr/local in its path, and--equally important--distutils also supports /usr/local.  (see Python dev response above)
Comment 2 Jan Matejek 2006-02-17 12:46:21 UTC
Fair enough, and they also mentioned ways to implement the desired behaviour. I'll start working on it ASAP.

(just on a side note: the python defaults actually do not support this behaviour as they are, it's a side effect of the default configuration. Fortunately, python makes it easy to implement.)
Comment 3 Jan Matejek 2006-02-17 12:47:04 UTC
*** Bug 149843 has been marked as a duplicate of this bug. ***
Comment 4 Jan Matejek 2006-02-28 16:05:39 UTC
fixed in Python and updated all modules (hopefully)

Note that for sys.path to contain /usr/local/whatever, the directories must exist. That is the standard Python logic.
Comment 5 Karl Pietrzak 2006-02-28 16:45:27 UTC
(In reply to comment #4)
> fixed in Python and updated all modules (hopefully)

Awesome!  Thanks Jan Matejek. =)

> Note that for sys.path to contain /usr/local/whatever, the directories must
> exist. That is the standard Python logic.

Right, yes, I remember reading that part of the Python doc.

I just wanted to confirm that /usr/local/lib64 will be in the next x86_64 SuSE release, as /usr/local/lib64 is guaranteed to exist.

$ rpm -qf /usr/local/lib64
filesystem-10.0-4.2
$

I presume /usr/local/lib is guaranteed to exist on x86 SuSE releases.
Comment 6 Jan Matejek 2006-02-28 16:57:28 UTC
> I just wanted to confirm that /usr/local/lib64 will be in the next x86_64 SuSE
> release, as /usr/local/lib64 is guaranteed to exist.

> I presume /usr/local/lib is guaranteed to exist on x86 SuSE releases.

that's right, and both mentioned directories will be there