From: Bill W. <wp...@gm...> - 2005-09-23 22:55:00
|
On 9/23/05, Valentin Ruano <val...@gm...> wrote: > Hi there, > I've got jython installed from the jpackage RPM in a Fedora Core 3 box. > > It starts fine, I can access some java classes and do some complex stuff > but went it comes down to do a simple query to the os package I've got > the following error: > > $ jython > Jython 2.2a0 on java1.4.2_08 (JIT: null) > >>> import os > >>> home =3D os.curdir > Traceback (innermost last): > File "<console>", line 1, in ? > AttributeError: class 'org.python.modules.os' has no attribute 'curdir' > >>> os.environ['http_proxy'] > Traceback (innermost last): > File "<console>", line 1, in ? > AttributeError: class 'org.python.modules.os' has no attribute 'environ' > > does anyone have the same issue? any ideas? It looks to me like a bug, > perhaps an installation or startup bug. > > thanks, V. Not a bug, just unexpected behavior. Java 2 does not, for instance, deal with environment variables. Instead, it deals with properties, which are passed in via the JVM command line or from a properties file. So os.environ has no meaning in Jython, because it's not ther in Java. Some of the methods might be covered in the Jython FAQ, sections 3.9 and 3.10. Take a look at http://www.jython.org/cgi-bin/faqw.py?req=3Dall . Otherwise use the Java classes for File, Directory, and Property manipulation. - Bill -- Bill Woodward wp...@sa... http://www.saifa.net "I have more trouble with D. L. Moody than with any other man I ever met." -- D. L. Moody s/D. L. Moody/Bill Woodward/g |