New submission from leiju: See the simple test below:
failed on 13.3.0 Darwin Kernel Version 13.3.0, Python 2.7.8: ============================================================ Python 2.7.8 (v2.7.8:ee879c0ffa11, Jun 29 2014, 21:07:35) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> >>> >>> import re >>> >>> p = '(abc)|(def)|(xyz)' >>> s = 'abcdefxyz' >>> >>> >>> for s in re.finditer(p, s): print s.groups() ... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 186, in finditer return _compile(pattern, flags).finditer(string) TypeError: expected string or buffer >> same test succeeds on Windows 7 professional: ============================================ Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> >>> >>> p = '(abc)|(def)|(xyz)' >>> s = 'abcdefxyz' >>> >>> import re >>> >>> for x in re.finditer(p, s): print x.groups() ... ('abc', None, None) (None, 'def', None) (None, None, 'xyz') >>> >>> >>> >>> same test succeeds on freedbsd 7.4. Python 2.7.1: ================================================= Python 2.7.1 (r271:86832, Jan 31 2011, 17:18:31) [GCC 4.2.1 20070719 [FreeBSD]] on freebsd7 Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> p = '(abc)|(def)|(xyz)' >>> s = 'abcdefxyz' >>> for s in re.finditer(p, s): print s.groups() ... ('abc', None, None) (None, 'def', None) (None, None, 'xyz') >>> >>> >>> >>> ---------- assignee: ronaldoussoren components: Macintosh, Regular Expressions messages: 225697 nosy: ezio.melotti, leiju, mrabarnett, ronaldoussoren priority: normal severity: normal status: open title: match object generated by re.finditer cannot call groups() on mac type: compile error versions: Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22254> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com