Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#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


>>> 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\", line 180, in compile
    return _compile(pattern, flags)
  File "C:\Python24\Lib\", 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?

Change History (1)

comment:1 Changed 14 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

Yes, indeed! Good catch. Fixed in [191].

Note: See TracTickets for help on using tickets.
Back to Top