From: <no...@so...> - 2001-01-31 10:46:57
|
Bug #129746, was updated on 2001-Jan-22 17:47 Here is a current snapshot of the bug. Project: Jython Category: Library Status: Closed Resolution: Fixed Bug Group: None Priority: 5 Submitted by: sjprocter Assigned to : bckfnn Summary: possibe bug in jython re package Details: re.findall throws an exception when processing some strings. Following is a code fragment which exhibits this. The only difference between the two strings in the example, okinput and badinput, is a space between the HTML tags in badinput. Calling findall on okinput works and on badinput generates an exception. When run from C python both strings are processed without exception. - Steven --- cut here --- import re def test(): imagepattern = '(?P<img><[ \t\n]*img[^>]*>)' framepattern = '(?P<frame><[ \t\n]*frame[^>]*>)' # embed directives that use a src= construction extractSrcTags = '(' + imagepattern + '|' + framepattern + ')' okinput = """<img src="foo bar"><frame src=baz>""" badinput = """<img src="foo bar"> <frame src=baz>""" print re.findall(extractSrcTags, okinput) print re.findall(extractSrcTags, badinput) --- cut here --- Here is the first bit of the exception: Traceback (innermost last): File "<console>", line 1, in ? File "E:\jakarta-tomcat\webapps\python\WEB-INF\source\bug.py", line 14, in tes t File "e:\jython-2.0\Lib\sre.py", line 59, in findall java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(Unknown Source) at org.python.modules.sre.SRE_STATE.getslice(SRE_STATE.java:1128) Follow-Ups: Date: 2001-Jan-31 02:46 By: bckfnn Comment: This appears to be fixed by my recent update to lastest CPython-2.1a1 version of sre. I have tested this with the CVS version of CPython. ------------------------------------------------------- For detailed info, follow this link: http://sourceforge.net/bugs/?func=detailbug&bug_id=129746&group_id=12867 |