diff options
Diffstat (limited to 'django/utils/_os.py')
| -rw-r--r-- | django/utils/_os.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/django/utils/_os.py b/django/utils/_os.py index 6507e58764..8309e08fbf 100644 --- a/django/utils/_os.py +++ b/django/utils/_os.py @@ -5,20 +5,19 @@ from os.path import abspath, dirname, join, normcase, sep from django.core.exceptions import SuspiciousFileOperation from django.utils.encoding import force_text +# For backwards-compatibility in Django 2.0 abspathu = abspath def upath(path): - """ - Always return a unicode path. - """ + """Always return a unicode path (did something for Python 2).""" return path def npath(path): """ Always return a native path, that is unicode on Python 3 and bytestring on - Python 2. + Python 2. Noop for Python 3. """ return path @@ -33,8 +32,8 @@ def safe_join(base, *paths): """ base = force_text(base) paths = [force_text(p) for p in paths] - final_path = abspathu(join(base, *paths)) - base_path = abspathu(base) + final_path = abspath(join(base, *paths)) + base_path = abspath(base) # Ensure final_path starts with base_path (using normcase to ensure we # don't false-negative on case insensitive operating systems like Windows), # further, one of the following conditions must be true: |
