Edgewall Software

Opened 13 years ago

Closed 12 years ago

#465 closed defect (wontfix)

Load template relative to ...

Reported by: MikeP Owned by: hodgestar
Priority: critical Milestone: 0.7
Component: Template processing Version: 0.6
Keywords: TemplateLoader Cc:

Description

In genshi/template/loader.py is wery annoying :-) error which make loading template on path relative to ... allmost impossible (in case non-unique template name).

Line 181 is:

        if relative_to and (not search_path or not os.path.isabs(relative_to)):
	            filename = os.path.join(os.path.dirname(relative_to), filename)
	
	        filename = os.path.normpath(filename)
	        cachekey = filename

but correct is:

        if relative_to and (not search_path or not os.path.isabs(filename)):
	            filename = os.path.join(os.path.dirname(relative_to), filename)
	
	        filename = os.path.normpath(filename)
	        cachekey = filename

Attachments (1)

loader.diff (695 bytes) - added by Nicolas Évrard <nicolas.evrard@…> 12 years ago.
patch following idea of MikeP

Download all attachments as: .zip

Change History (7)

comment:1 Changed 13 years ago by anonymous

  • Owner changed from cmlenz to anonymous

comment:2 Changed 13 years ago by anonymous

  • Owner changed from anonymous to MikeP

comment:3 Changed 13 years ago by Davian

Thought it woudln't to give it a shot. I was right.

comment:4 Changed 13 years ago by anonymous

  • Owner changed from MikeP to anonymous

Changed 12 years ago by Nicolas Évrard <nicolas.evrard@…>

patch following idea of MikeP

comment:5 Changed 12 years ago by hodgestar

  • Owner changed from anonymous to hodgestar
  • Status changed from new to assigned

Thanks! Would be good to have a test to go with the patch if possible.

comment:6 Changed 12 years ago by hodgestar

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

I no longer think this patch is correct. The comment above the lines you change seems to make it clear that the current behaviour was the intention and applying your patch breaks an existing test that checks explicitly for the current behaviour.

I'm happy to re-open this but I'll need a bit of a better description of your use-case and what needs to be supported.

Note: See TracTickets for help on using tickets.