Django

Code

Show
Ignore:
Timestamp:
10/06/08 01:34:54 (2 months ago)
Author:
mtredinnick
Message:

Added some better error reporting and path handling when creating template paths.

We now raise UnicodeDecodeError? for non-UTF-8 bytestrings (thanks to Daniel
Pope for diagnosing this was being swallowed by ValueError?) and allow UTF-8
bytestrings as template directories.

Refs #8965.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/utils/_os.py

    r5876 r9161  
    11from os.path import join, normcase, abspath, sep 
     2from django.utils.encoding import force_unicode 
    23 
    34def safe_join(base, *paths): 
     
    1112    # We need to use normcase to ensure we don't false-negative on case 
    1213    # insensitive operating systems (like Windows). 
     14    base = force_unicode(base) 
     15    paths = [force_unicode(p) for p in paths] 
    1316    final_path = normcase(abspath(join(base, *paths))) 
    1417    base_path = normcase(abspath(base))