#8965: UnicodeEncodeError in template path after migration from Django 0.96 to
1.0
---------------------------+------------------------------------------------
Reporter: anonymous | Owner: nobody
Status: new | Milestone:
Component: Uncategorized | Version: 1.0
Keywords: | Stage: Unreviewed
Has_patch: 0 |
---------------------------+------------------------------------------------
My templates are in a dir with a non-ascii char. Something like:
u"/foo/bar/para'''í'''so/templates".
With Django-0.96 works fine. With Django-1.0 internal testing server
(./manage.py runserver) works fine too. But with apache and mod_python
throws an UnicodeEncodeError ('ascii' codec can't encode character u'\xed'
in position 13: ordinal not in range(128)) in /var/lib/python-
support/python2.5/django/template/loaders/filesystem.py, in
load_template_source:
{{{
return (open(filepath).read().decode(settings.FILE_CHARSET), filepath)
}}}
settings.FILE_CHARSET is "utf-8". filepath is something like
u"/foo/bar/paraíso/templates/foobar.html". It comes from TEMPLATE_DIRS in
settings.py, that it looks like:
{{{
TEMPLATE_DIRS = (unicode(os.path.join(os.path.dirname(__file__),
'templates').replace('\\','/'), "utf-8"), )
}}}
If I put template dir without unicode conversion both runserver and
mod_python+apache gives a "cannot extend foobar.html because template
doesn't exist" error.
--
Ticket URL: <http://code.djangoproject.com/ticket/8965>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---