Message5081
The built-in help() function fails with an exception. I traced the cause
to code in pydoc.py failing because sys.executable is None for the
stand-alone Jython.
C:\tools\jython2.5.1rc1>java -jar jython.jar
Jython 2.5.1rc1 (Release_2_5_1rc1:6736:6741, Sep 1 2009, 10:37:37)
[Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_06
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
>>> help()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\home\davhan\tools\jython2.5.1rc1\jython.jar\Lib\site.py",
line 348, in __call__
File "C:\home\davhan\tools\jython2.5.1rc1\jython.jar\Lib\pydoc.py",
line 1812, in <module>
File "C:\home\davhan\tools\jython2.5.1rc1\jython.jar\Lib\pydoc.py",
line 1626, in __init__
File "C:\home\davhan\tools\jython2.5.1rc1\jython.jar\Lib\ntpath.py",
line 209, in dirname
File "C:\home\davhan\tools\jython2.5.1rc1\jython.jar\Lib\ntpath.py",
line 166, in split
File "C:\home\davhan\tools\jython2.5.1rc1\jython.jar\Lib\ntpath.py",
line 121, in splitdrive
TypeError: 'NoneType' object is unsubscriptable
In a non-standalone Jython installation, sys.executable is set to the
path to jython.bat file, and the help() function works.
Here is a patch to pydoc.py that fixes this problem:
1626c1626,1629
< execdir = os.path.dirname(sys.executable)
---
> if sys.executable is None:
> execdir = os.getcwd()
> else:
> execdir = os.path.dirname(sys.executable) |
|
Date |
User |
Action |
Args |
2009-09-01 23:00:25 | dhandy | set | recipients:
+ dhandy |
2009-09-01 23:00:25 | dhandy | set | messageid: <1251846025.52.0.144195867675.issue1452@psf.upfronthosting.co.za> |
2009-09-01 23:00:25 | dhandy | link | issue1452 messages |
2009-09-01 23:00:24 | dhandy | create | |
|