Edgewall Software

Opened 17 years ago

Closed 17 years ago

#139 closed defect (invalid)

TemplateLoader's auto_reload doesn't actually automatically reload

Reported by: dackze+genshi@… Owned by: cmlenz
Priority: major Milestone:
Component: General Version: devel
Keywords: Cc:

Description

As far as I can tell, auto_reload in genshi.template.loader.TemplateLoader does nothing, due to some dubious logic where it always checks modified times, regardless of what it's set to. I'm attaching a patch which I believe fixes this behavior.

Attachments (1)

auto_reload.patch (584 bytes) - added by dackze+genshi@… 17 years ago.
Fixes auto_reload

Download all attachments as: .zip

Change History (4)

Changed 17 years ago by dackze+genshi@…

Fixes auto_reload

comment:1 Changed 17 years ago by cmlenz

Maybe I'm overlooking something obvious (wouldn't be the first time), but I think the logic is actually correct: If auto_reload is disabled, then not self.auto_reload evaluates to True and short-circuits the if expression: the mtime-check is not performed and the cached template is returned immediatiely.

comment:2 Changed 17 years ago by mgood

Yeah, the logic appears correct to me as well.

Dackze: were you experiencing problems with auto reloading, or just looking at the code? If you were having problems can you provide some more information, or even a unit test showing the problem?

comment:3 Changed 17 years ago by cmlenz

  • Milestone 0.5 deleted
  • Resolution set to invalid
  • Status changed from new to closed

In a discussion on IRC we found that this ticket is due to a misunderstanding of how auto_reload should work, so I'm closing this.

If you find out what the actual problem / circumstance was that caused Genshi to not reload your template, please file a new ticket.

Note: See TracTickets for help on using tickets.