Opened 14 years ago

Closed 13 years ago

Last modified 12 years ago

#12068 closed (fixed)

The {% url %} parser can fail with StopIteration

Reported by: Johannes Dollinger Owned by: Stefan Moluf
Component: Template system Version: 1.1
Severity: Keywords: url tag
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

>>> Template("{% url view as %}")
...
  File "/django/template/defaulttags.py", line 1122, in url
    asvar = bits.next()
StopIteration

This should either work (variables may be named as) or fail with TemplateSyntaxError.

Attachments (1)

12068.diff (3.6 KB ) - added by Stefan Moluf 14 years ago.
Same patch, but with some nitpicky style changes

Download all attachments as: .zip

Change History (9)

comment:1 by Russell Keith-Magee, 14 years ago

milestone: 1.2
Triage Stage: UnreviewedAccepted

comment:2 by Russell Keith-Magee, 14 years ago

See also #12069

comment:3 by Stefan Moluf, 14 years ago

Owner: changed from nobody to Stefan Moluf

by Stefan Moluf, 14 years ago

Attachment: 12068.diff added

Same patch, but with some nitpicky style changes

comment:4 by alexdutton, 14 years ago

Triage Stage: AcceptedDesign decision needed

We currently disallow {% url view as %}, but accept {{ as }}. Should there be some consistency twixt the two?

Indeed, should any attempt to pass a keyword-named variable into a Context throw some error?

comment:5 by Chris Beaven, 14 years ago

Alternatively, would be fixed by my patch in #12945

comment:6 by James Bennett, 14 years ago

milestone: 1.21.3

This is enough of an edge case that I'm comfortable punting it from 1.2.

comment:7 by Łukasz Rekucki, 13 years ago

Resolution: fixed
Status: newclosed

This is fixed on 1.2.x and trunk, probably for a while now.

comment:8 by Jacob, 12 years ago

milestone: 1.3

Milestone 1.3 deleted

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