Django

Code

Show
Ignore:
Timestamp:
11/13/08 13:03:42 (2 months ago)
Author:
kmtracey
Message:

Fixed #9579 -- Properly handle apps running with (and specifically, loading templates from) a current working directory path that contains non-ASCII characters. Thanks for the report to gonzalodelgado and for advice on how to fix it to Daniel Pope.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/template/loaders/app_directories.py

    r9161 r9411  
    55 
    66import os 
     7import sys 
    78 
    89from django.conf import settings 
     
    1213 
    1314# At compile time, cache the directories to search. 
     15fs_encoding = sys.getfilesystemencoding() or sys.getdefaultencoding() 
    1416app_template_dirs = [] 
    1517for app in settings.INSTALLED_APPS: 
     
    2830    template_dir = os.path.join(os.path.dirname(mod.__file__), 'templates') 
    2931    if os.path.isdir(template_dir): 
    30         app_template_dirs.append(template_dir
     32        app_template_dirs.append(template_dir.decode(fs_encoding)
    3133 
    3234# It won't change, so convert it to a tuple to save memory.