Edgewall Software

Opened 18 years ago

Closed 18 years ago

#33 closed defect (fixed)

[PATCH] Using IncludeFilter can trip assertions in Template.generate

Reported by: robinbryce@… Owned by: cmlenz
Priority: minor Milestone: 0.2
Component: Template processing Version: 0.1
Keywords: Cc:

Description

Using IncludeFilter like this:

Template(source).generate().filter(
    IncludeFilter(TemplateLoader(['']))
    ).render()

will cause an assertion failure in Template.generate. This happens because IncludeFilter is called with no arguments when it is applied by markup.core:Stream.filter.

Utlimately the propogation of the defaults, and pythons rules for kwargs/args processing, conspire to pass None as the first argument to Template.generate.

The attatched patch simply detects this case and treats it as equivelent to calling generate with no arguments.

Attachments (1)

patch_against_r215.diff (442 bytes) - added by robinbryce@… 18 years ago.

Download all attachments as: .zip

Change History (3)

Changed 18 years ago by robinbryce@…

comment:1 Changed 18 years ago by cmlenz

  • Component changed from Serialization to Template processing
  • Status changed from new to assigned

Good catch, thanks!

comment:2 Changed 18 years ago by cmlenz

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

Applied in [218].

Note: See TracTickets for help on using tickets.