Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#27781 closed Bug (fixed)

simplify_regex() doesn't remove ? characters

Reported by: Mariusz Felisiak Owned by: Mariusz Felisiak
Component: contrib.admindocs Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

django.contrib.admindocs.views.simplify_regex leaves outstanding regex characters, e.q.

>>> simplify_regex(r'^a/?$')
'/a/?'

instead of

>>> simplify_regex(r'^a/?$')
'/a/'

Regression in f0ef0c49e9284f262fbc63e8a497699ca4a248fe (see ticket #26621).

I'm not sure it's a bug or intentional behavior change.

Attachments (1)

27781.diff (592 bytes ) - added by Mariusz Felisiak 7 years ago.

Download all attachments as: .zip

Change History (7)

by Mariusz Felisiak, 7 years ago

Attachment: 27781.diff added

comment:1 by Mariusz Felisiak, 7 years ago

Summary: simplify_regexsimplify_regex leaves outstanding regex characters

comment:2 by Tim Graham, 7 years ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

I think that's an inadvertent change due to lack of test coverage for the .replace('?', '') removal.

comment:3 by Mariusz Felisiak, 7 years ago

Has patch: set

comment:4 by Tim Graham <timograham@…>, 7 years ago

Resolution: fixed
Status: assignedclosed

In c37ec5a6:

Fixed #27781 -- Made simplify_regex() remove outstanding '?' characters.

Regression in f0ef0c49e9284f262fbc63e8a497699ca4a248fe.

comment:5 by Tim Graham <timograham@…>, 7 years ago

In 092f09f:

[1.11.x] Fixed #27781 -- Made simplify_regex() remove outstanding '?' characters.

Regression in f0ef0c49e9284f262fbc63e8a497699ca4a248fe.

Backport of c37ec5a6595f963a04fae1b17858225c2b3d08c4 from master

comment:6 by Tim Graham, 7 years ago

Summary: simplify_regex leaves outstanding regex characterssimplify_regex() doesn't remove ? characters
Note: See TracTickets for help on using tickets.
Back to Top