[Python-bugs-list] [Bug #110680] bad pos value on match object (PR#397)

noreply@sourceforge.net noreply@sourceforge.net
Sun, 6 Aug 2000 13:50:05 -0700


Bug #110680, was updated on 2000-Jul-31 14:14
Here is a current snapshot of the bug.

Project: Python
Category: Modules
Status: Closed
Resolution: Fixed
Bug Group: None
Priority: 5
Summary: bad pos value on match object (PR#397)

Details: Jitterbug-Id: 397
Submitted-By: jeremy@beopen.com
Date: Thu, 13 Jul 2000 21:42:47 -0400 (EDT)
Version: CVS Thu Jul 13 21:43:09 EDT 2000
OS: 


The pos attribute of a match object is supposed to match the value of
the optional pos argument passed to match or search.  The default
value of the argument is zero.  The current implementation sets pos to
be the start of the match instead.

This program demonstrates:

import re
buf = "abcdef"
rx = re.compile("b(c)")
mo = rx.search(buf)
print mo.pos, mo.endpos
print mo.start(1), mo.end(1)

bitdiddle:/tmp> python1.5 retest.py 
0 6
2 3
bitdiddle:/tmp> python retest.py 
1 6
2 3




====================================================================
Audit trail:
Fri Jul 14 11:35:54 2000	jeremy	moved from incoming to open

Follow-Ups:

Date: 2000-Aug-06 13:50
By: twouters

Comment:
Jeremy, this looks fixed. (I get the '1.5' behaviour in both 'sre' and 'pre' in current CVS snapshots.) Please re-open this bugreport (and assign to effbot, I assume) if you still see the bug (and mark it platform-dependant -- I don't see it on BSDI or Linux, in any case.)

-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=110680&group_id=5470