Issue1892

classification
Title: site-packages is not in sys.path
Type: behaviour Severity: major
Components: Core Versions: 2.7a1
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: Nsakala, fwierzbicki, pjenvey
Priority: high Keywords:

Created on 2012-05-22.08:46:21 by Nsakala, last changed 2012-05-22.17:05:21 by fwierzbicki.

Messages
msg7127 (view) Author: Stephane (Nsakala) Date: 2012-05-22.08:46:20
!! Source cloned and compiled form trunk (http://hg.python.org/jython)

/opt/jython-2.7a1+/bin/jython -c 'import sys; print sys.path'
['', '/opt/jython-2.7a1+/Lib', '/opt/jython-2.7a1+/__classpath__', '/opt/jython-2.7a1+/__pyclasspath__']

!! The problem is located at Lib/site.py line 68, python_implementation is a function so this will always be False

_is_jython = _platform.python_implementation == "Jython"

!! fix

_is_jython = _platform.python_implementation() == "Jython"
msg7129 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2012-05-22.15:09:28
How embarrassing, thanks for catching this!
msg7130 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2012-05-22.15:53:08
Fixed in default branch.
msg7131 (view) Author: Philip Jenvey (pjenvey) Date: 2012-05-22.16:26:01
I'd actually try to avoid the platform import entirely as it'll add (albeit slightly, but I think every import 'counts' for Jython) to startup time
msg7132 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2012-05-22.16:34:29
pjenvey: sure - I've always hated sys.platform.startswith("java") -- but startup time is more important. Besides, it looks like 3.3 will have a nicer string to look up with the sys.implementation PEP http://www.python.org/dev/peps/pep-0421/ so I'll go and make sure to kill the platform imports where I've put them in.
msg7133 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2012-05-22.17:05:21
ok "import platform" calls removed in favor of the old sys.platform.startswith("java")
History
Date User Action Args
2012-05-22 17:05:21fwierzbickisetmessages: + msg7133
2012-05-22 16:34:29fwierzbickisetmessages: + msg7132
2012-05-22 16:26:01pjenveysetnosy: + pjenvey
messages: + msg7131
2012-05-22 15:53:08fwierzbickisetstatus: open -> closed
resolution: accepted -> fixed
type: behaviour
messages: + msg7130
2012-05-22 15:09:28fwierzbickisetpriority: high
assignee: fwierzbicki
resolution: accepted
messages: + msg7129
nosy: + fwierzbicki
2012-05-22 08:46:21Nsakalacreate