Code

Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#54 closed defect (fixed)

pattern in url_dispatch.txt maybe wrong

Reported by: james 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: UI/UX:

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?

Attachments (0)

Change History (1)

comment:1 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.