Error when loading templates from Python eggs
|Reported by:||Juan Manuel Caicedo <juan.manuel.caicedo@…>||Owned by:||nobody|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The template loader for using templates included in Python eggs (django.template.loaders.eggs.load_template_source) has a bug that raises an exception when a template, thus the loader never finds an existent template and always raises the TemplateDoesNotExist exception.
The bug was introduced in changeset  (see the diff), when the decode function is called on the tuple that should be returned, not on the template string that is returned by the resource_string function.
If the template exists in a egg, instead of return it, an exception is raised with the following message:
'tuple' object has no attribute 'decode'
I attach here a patch that calls the function correctly.
Change History (7)
Changed 8 years ago by Juan Manuel Caicedo <juan.manuel.caicedo@…>
comment:1 Changed 8 years ago by ubernostrum
- Needs documentation unset
- Needs tests set
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted