diff options
| author | Tim Graham <timograham@gmail.com> | 2015-02-17 18:48:15 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-02-17 18:48:15 -0500 |
| commit | fa66ea75326e669cd3d51fb926a4364b8ba08959 (patch) | |
| tree | 8e22549a4df6a1fe7e4b79f35390dee4d331ad5e | |
| parent | bebc1e53a3ab059849e5c4e5a55b2f5e68b67169 (diff) | |
Refs #24324 -- Fixed UnicodeDecodeError in MigrationWriter on Python 2.
| -rw-r--r-- | django/db/migrations/writer.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/migrations/writer.py b/django/db/migrations/writer.py index 511913177f..d6d17aa988 100644 --- a/django/db/migrations/writer.py +++ b/django/db/migrations/writer.py @@ -228,11 +228,11 @@ class MigrationWriter(object): # In case of using MIGRATION_MODULES setting and the custom # package doesn't exist, create one. package_dirs = migrations_package_name.split(".") - create_path = os.path.join(sys.path[0], *package_dirs) + create_path = os.path.join(upath(sys.path[0]), *package_dirs) if not os.path.isdir(create_path): os.makedirs(create_path) for i in range(1, len(package_dirs) + 1): - init_dir = os.path.join(sys.path[0], *package_dirs[:i]) + init_dir = os.path.join(upath(sys.path[0]), *package_dirs[:i]) init_path = os.path.join(init_dir, "__init__.py") if not os.path.isfile(init_path): open(init_path, "w").close() |
