|
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
|