Message10289
On OS X 10.10.5
$ jython27
Jython 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_45
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getpid()
36949
On Windows 8.1:
c:\jython2.7.0>bin\jython.exe
Jython 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_55
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getpid()
5512
It's possible you have an implicit security manager policy running. Thi function, like other similar Posix functions, is not available if the underlying Posix support is missing. Using the python_home.policy found in our tests (see usage in test_java_integration.py), which may be more restrictive than what you might be using (namely the readFileDescriptor failure):
grant codeBase "file:${python.home}/-" {
permission java.io.FilePermission "<<ALL FILES>>", "read,write";
permission java.lang.RuntimePermission "accessDeclaredMembers";
permission java.lang.RuntimePermission "createClassLoader";
permission java.lang.RuntimePermission "getProtectionDomain";
permission java.util.PropertyPermission "*", "read,write";
};
$ jython27 -J-Djava.security.manager -J-Djava.security.policy=python_home.policy
console: Failed to install 'org.python.util.JLineConsole': java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "readFileDescriptor").
Jython 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_45
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getpid()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'getpid' |
|
Date |
User |
Action |
Args |
2015-09-24 21:11:43 | zyasoft | set | messageid: <1443129103.95.0.714230278441.issue2405@psf.upfronthosting.co.za> |
2015-09-24 21:11:43 | zyasoft | set | recipients:
+ zyasoft, mishikal@yahoo.com |
2015-09-24 21:11:43 | zyasoft | link | issue2405 messages |
2015-09-24 21:11:43 | zyasoft | create | |
|