regex match.groupdict() returns wrong values
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ironpython (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: ironpython
match object's groupdict() returns wrong key & value combinations.
Attached is a test case to reproduce the problem.
Works:
IronPython 2.6 for .NET2.0 SP1 on Windows XP SP3 32bit
CPython2.6 on Ubuntu 10.04LTS i386
CPython2.6 on Ubuntu 10.04LTS x86_64
Does'nt work:
ironpython 2.6~beta2-2 on Ubuntu 10.04.1 LTS i386
ironpython 2.6~beta2-2 on Ubuntu 10.04.1 LTS x86_64
#Test case
import re
p = re.compile(r'''
(?:
@)?
(?:
)?
'''
, re.X)
m = p.match('http://
print m.groups()
print m.groupdict()
# expected result. dict keys in arbitrary order
('http', 'user', 'pass', 'localhost', '666', 'xyz')
{'username': 'user', 'protocol': 'http', 'database': 'xyz', 'host': 'localhost', 'password': 'pass', 'port': '666'}
# results on ubuntu 10.04LTS i386/x86_64
('http', 'user', 'pass', 'localhost', '666', 'xyz')
{'username': 'http://
Preliminary investigation revealed that the regex bug was not of ironpython but mono.
Test case worked fine with MS System.dll dropped in.