From: Jan D. <jan...@fr...> - 2001-01-19 04:14:06
|
Finn Bock wrote: > > I am happy to announce the release of Jython 2.0. > I just downloaded Jython2.0, and tried it out on some of my CPython files. I got in trouble with something that looks OK to me, and that works fine in CPython. I've simulated it in interactive mode: Jython 2.0 on java1.1.4 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import re >>> print re.split("=","X=10") ['X', '10'] >>> print re.split(r"\s=\s","X = 10") ['X', '10'] >>> print re.split(r"\s+=\s+","X = 10") ['X', '10'] >>> print re.split(r"\s*=\s*","X = 10") Traceback (innermost last): File "<console>", line 1, in ? File "C:\WINNT\Java\jython-2.0\Lib\sre.py", line 56, in split File "C:\WINNT\Java\jython-2.0\Lib\sre.py", line 151, in _split java.lang.ArrayIndexOutOfBoundsException Is this a bug, or does Jython use another RE syntax? Regards, Jan |
From: Venkatesh P. R. <rvp...@ci...> - 2001-01-19 04:28:42
|
Hi, I tried the same example with jython 2.0 (jre/jdk 1.3.0 on a linux box) and it works fine. Can it be something to do with the underlying jvm? Guessing. - Venkatesh |
From: <bc...@wo...> - 2001-01-19 12:34:32
|
On Fri, 19 Jan 2001 05:14:08 +0100, you wrote: >I just downloaded Jython2.0, and tried it out on some of my CPython >files. I got in trouble with something that looks OK to me, and that >works fine in CPython. I've simulated it in interactive mode: > >Jython 2.0 on java1.1.4 (JIT: null) >Type "copyright", "credits" or "license" for more information. >>>> import re >>>> print re.split(r"\s*=\s*","X = 10") >Traceback (innermost last): > File "<console>", line 1, in ? > File "C:\WINNT\Java\jython-2.0\Lib\sre.py", line 56, in split > File "C:\WINNT\Java\jython-2.0\Lib\sre.py", line 151, in _split >java.lang.ArrayIndexOutOfBoundsException > >Is this a bug, or does Jython use another RE syntax? The Jython RE syntax is exactly the same as CPython2.0. What you have encountered is a bug in the Microsoft JVM. To workaround the bug, you can either: - Install some other JVM. I use javasoft SDK myself. http://www.javasoft.com/j2se/ - Enable the apache ORO matcher. You enable the ORO matcher by adding this line to your <jython.home>/registry file: python.modules.builtin = re By rewriting the code a little bit, I have avoided the MS bug, so the problem will not exist in the next release of jython. regards, finn |
From: D-Man <ds...@ri...> - 2001-01-23 00:25:44
|
On Fri, Jan 19, 2001 at 12:33:50PM +0000, Finn Bock wrote: [snip] | The Jython RE syntax is exactly the same as CPython2.0. What you have | encountered is a bug in the Microsoft JVM. Surprising? ;-) [snip] | By rewriting the code a little bit, I have avoided the MS bug, so the | problem will not exist in the next release of jython. IMO, you shouldn't be expending effort to fix M$ bugs Finn. But I'm sure the people using the M$ JVM will appreciate it. You certainly work hard to make jython work the Right Way. :-) | | regards, | finn | -D |