Bug 111438
Summary: | PEP 273 changes sys.path[1] value | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Jeff Johnson <jbj> |
Component: | python | Assignee: | Mihai Ibanescu <mihai.ibanescu> |
Status: | CLOSED NOTABUG | QA Contact: | Brock Organ <borgan> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 1 | CC: | nobody+pnasrat |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2004-04-05 20:38:37 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Jeff Johnson
2003-12-03 18:06:41 UTC
There are other ways to look at the installation location: python -c "from distutils import sysconfig; print sysconfig.get_config_var('LIBDEST')" (you'll need python-devel though, unless I move /usr/lib/python2.3/config/Makefile into python, which would be possible too since distutils would break otherwise). Here's something else that can happen: PYTHONPATH=afdadfasdfadf python -c "import sys; print sys.path" ['', 'afdadfasdfadf', '/usr/lib/python1.5/', '/usr/lib/python1.5/plat-linux-i386', '/usr/lib/python1.5/lib-tk', '/usr/lib/python1.5/lib-dynload', '/usr/lib/python1.5/site-packages'] This is on python 1.5. PYTHONPATH is documented and it will munge sys.path; I think relying on sys.path is bogus in the first place. Indeed according to Gustavo sys.prefix is what should be being looked at here: python -c "import sys; print '%s/lib/python%s\n' % (sys.prefix,sys.version[:3])" not quite as terse but probably more portable The above isn't multilib clean as it's hard coded lib, looks like the fragment in comment #1 is probably best for rpm-python as it buildrequires python-devel anyway. Closing |