#54 closed defect (fixed)
pattern in url_dispatch.txt maybe wrong
Reported by: | James Zhu | Owned by: | Jacob |
---|---|---|---|
Component: | Documentation | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
>>> import re >>> a = r'^/articles/(?P\d{4})/$' >>> re.compile( a ) Traceback (most recent call last): File "<input>", line 1, in ? File "C:\Python24\Lib\sre.py", line 180, in compile return _compile(pattern, flags) File "C:\Python24\Lib\sre.py", line 227, in _compile raise error, v # invalid expression error: unknown specifier: ?P\d >>> a = r'^/articles/(?P<year>\d{4})/$' >>> re.compile( a ) <_sre.SRE_Pattern object at 0x01093350>
Should we add the group name in patterns?
Note:
See TracTickets
for help on using tickets.
Yes, indeed! Good catch. Fixed in [191].