Jean-Yves,

Supporting Java 8 is exactly the sort of thing we should ensure Jython 2.5.4 supports. We have had 2.5.4 release candidate out for a while, clearly we need to update with a new one and just get it out.

Hopefully, this is simply a matter of applying the patches seen here, in this order, due to the fact that there was a partial backout, as discussed in the commit log:

http://hg.python.org/jython/rev/01460e803ef3
http://hg.python.org/jython/rev/05622c95c3d7

- Jim


On Wed, Jun 18, 2014 at 5:34 AM, jean-yves toumit <jean-yves.toumit@oracle.com> wrote:
HI all,
as we work to get our product working on jdk 8, we are experiencing problems with Jython and Java 8: whenever we launch our app (which has been running fine in jdk 6 and 7) with jdk8, we get an error that traces back to:
  File "/opt/SUNWoccli/private/jython/Lib/pwd.py", line 47, in getpwuid
    entry = _posix.getpwuid(uid)
  File "/opt/SUNWoccli/private/jython/Lib/os.py", line 105, in unimplementedError
    raise NotImplementedError(method_name)
The version of Jython we're currently using is 2.5.1 Final. I guess that there is some compatibility problem here.

I have created a very simple script:
import pwd
pwd.getpwuid(0)
I've ran that script on JDK7 and 8 with different standalone versions of jython (to avoid conflicts with installed versions of python) that I just freshly downloaded. Here are the results:

JDK 7
JDK 8
Jython 2.5.1
Runs fine
File "/root/jython/jython251/Lib/pwd.py", line 47, in getpwuid
  entry = _posix.getpwuid(uid)
File "/root/jython/jython251/Lib/os.py", line 105, in unimplementedError
  raise NotImplementedError(method_name)
Jython 2.5.2
File "/root/jython/jython252/Lib/pwd.py", line 54, in getpwuid
  return struct_passwd(entry)
File "/root/jython/jython252/Lib/pwd.py", line 32, in __new__
  pwd = (newString(pwd.loginName), newString(pwd.password), int(pwd.UID),
NotImplementedError: passwd.pw_passwd unimplemented
File "/root/jython/jython252/Lib/pwd.py", line 54, in getpwuid
  return struct_passwd(entry)
File "/root/jython/jython252/Lib/pwd.py", line 32, in __new__
  pwd = (newString(pwd.loginName), newString(pwd.password), int(pwd.UID),
NotImplementedError: passwd.pw_passwd unimplemented
Jython 2.5.3
File "/root/script.py", line 1, in <module>
  import pwd
ImportError: No module named pwd
File "/root/script.py", line 1, in <module>
  import pwd
ImportError: No module named pwd
Jython 2.5.4 rc1   File "/root/jython/jython-standalone-2.5.4-rc1.jar/Lib/pwd.py", line 54, in getpwuid
  File "/root/jython/jython-standalone-2.5.4-rc1.jar/Lib/pwd.py", line 32, in __new__
NotImplementedError: passwd.pw_passwd unimplemented
  File "/root/jython/jython-standalone-2.5.4-rc1.jar/Lib/pwd.py", line 54, in getpwuid
  File "/root/jython/jython-standalone-2.5.4-rc1.jar/Lib/pwd.py", line 32, in __new__
NotImplementedError: passwd.pw_passwd unimplemented
Jython 2.7 beta2 Runs ok.
Runs ok.

Have any tests with jdk8 been done and are there known incompatibilities? This method pwd.getpwuid() is one method that causes problem for us but I guess that it might hide a lot of other problems when switching to JDK 8.

Would it help to upgrade to a stable version that would be known to be compatible with jdk8? (aside from this pwd problem - maybe we should use another method to retrieve that path to make it compatible across versions?) Switching to a newer version of jython may also bring regressions in JDK 7 (as shown in the table) so it is quite a tricky position. I also see that the standalone jython 2.7 beta is built for java 7 and higher, and doesn't run with JDK 6 (whereas previous versions seem to work fine).
Thanks,
JY.

--
Jean-Yves Toumit | Software Developer
Phone: +330 437434661 | Mobile: +330 601774288
Oracle Development

ORACLE France | 180, Avenue de L'Europe Zirst de Montbonnot | 38330 Montbonnot Saint-Martin

Oracle is committed to developing practices and products that help protect the environment

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users