Created on 2017-05-15 19:47 by serhiy.storchaka, last changed 2017-05-18 10:46 by serhiy.storchaka. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 1595 | merged | serhiy.storchaka, 2017-05-15 19:55 | |
| PR 1604 | merged | serhiy.storchaka, 2017-05-16 12:38 | |
| PR 1605 | merged | serhiy.storchaka, 2017-05-16 12:43 | |
| PR 1648 | merged | serhiy.storchaka, 2017-05-18 10:24 | |
| Messages (5) | |||
|---|---|---|---|
| msg293736 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2017-05-15 19:47 | |
When compile a regular expression with groups or conditionals emitted warnings point on lines in the re module implementation rather than the line in user code.
>>> import re
>>> re.compile('x(?i)')
__main__:1: DeprecationWarning: Flags not at the start of the expression x(?i)
re.compile('x(?i)', re.IGNORECASE)
>>> re.compile('(x(?i))')
/home/serhiy/py/cpython/Lib/re.py:281: DeprecationWarning: Flags not at the start of the expression (x(?i))
p = sre_compile.compile(pattern, flags)
re.compile('(x(?i))', re.IGNORECASE)
>>> re.compile('((x(?i)))')
/home/serhiy/py/cpython/Lib/sre_parse.py:889: DeprecationWarning: Flags not at the start of the expression ((x(?i)))
p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, False)
re.compile('((x(?i)))', re.IGNORECASE)
Proposed patch fixes this:
>>> import re
>>> re.compile('x(?i)')
__main__:1: DeprecationWarning: Flags not at the start of the expression x(?i)
re.compile('x(?i)', re.IGNORECASE)
>>> re.compile('(x(?i))')
__main__:1: DeprecationWarning: Flags not at the start of the expression (x(?i))
re.compile('(x(?i))', re.IGNORECASE)
>>> re.compile('((x(?i)))')
__main__:1: DeprecationWarning: Flags not at the start of the expression ((x(?i)))
re.compile('((x(?i)))', re.IGNORECASE)
|
|||
| msg293758 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2017-05-16 12:16 | |
New changeset c7ac7280c321b3c1679fe5f657a6be0f86adf173 by Serhiy Storchaka in branch 'master': bpo-30375: Correct the stacklevel of regex compiling warnings. (#1595) https://github.com/python/cpython/commit/c7ac7280c321b3c1679fe5f657a6be0f86adf173 |
|||
| msg293768 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2017-05-16 15:16 | |
New changeset 73fb45df0487144765808c5d25914c67232d83fe by Serhiy Storchaka in branch '3.6': [3.6] bpo-30375: Correct the stacklevel of regex compiling warnings. (GH-1595) (#1604) https://github.com/python/cpython/commit/73fb45df0487144765808c5d25914c67232d83fe |
|||
| msg293769 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2017-05-16 15:16 | |
New changeset 24b5ed230df65f6a1f9d8dd0c4409377576113d9 by Serhiy Storchaka in branch '3.5': [3.5] bpo-30375: Correct the stacklevel of regex compiling warnings. (GH-1595) (#1605) https://github.com/python/cpython/commit/24b5ed230df65f6a1f9d8dd0c4409377576113d9 |
|||
| msg293918 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2017-05-18 10:46 | |
New changeset dfcfc915787def056e225fb22ad5a5ee8da4052f by Serhiy Storchaka in branch '2.7': [2.7] bpo-30375: Correct the stacklevel of regex compiling warnings. (#1595) (#1648) https://github.com/python/cpython/commit/dfcfc915787def056e225fb22ad5a5ee8da4052f |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2017-05-18 10:46:58 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2017-05-18 10:46:20 | serhiy.storchaka | set | messages: + msg293918 |
| 2017-05-18 10:24:58 | serhiy.storchaka | set | pull_requests: + pull_request1743 |
| 2017-05-16 15:16:55 | serhiy.storchaka | set | messages: + msg293769 |
| 2017-05-16 15:16:29 | serhiy.storchaka | set | messages: + msg293768 |
| 2017-05-16 12:46:02 | serhiy.storchaka | set | versions: + Python 2.7 |
| 2017-05-16 12:43:24 | serhiy.storchaka | set | pull_requests: + pull_request1696 |
| 2017-05-16 12:38:47 | serhiy.storchaka | set | pull_requests: + pull_request1695 |
| 2017-05-16 12:16:18 | serhiy.storchaka | set | messages: + msg293758 |
| 2017-05-15 19:55:58 | serhiy.storchaka | set | pull_requests: + pull_request1689 |
| 2017-05-15 19:47:50 | serhiy.storchaka | create | |