diff options
| author | Andrew Godwin <andrew@aeracode.org> | 2013-06-28 17:32:57 +0100 |
|---|---|---|
| committer | Andrew Godwin <andrew@aeracode.org> | 2013-06-28 17:32:57 +0100 |
| commit | 7a47ba6f6aeca36b8b092dbafd36abb342d34d4b (patch) | |
| tree | e959922f7d4d08057225459e31697f410e26df26 /django/core | |
| parent | e2d7e83256234251a81ad3388428f6579795a672 (diff) | |
| parent | 48dd1e63bbb93479666208535a56f8c7c4aeab3a (diff) | |
Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
django/db/backends/__init__.py
django/db/models/fields/related.py
tests/field_deconstruction/tests.py
Diffstat (limited to 'django/core')
| -rw-r--r-- | django/core/checks/__init__.py (renamed from django/core/compat_checks/__init__.py) | 0 | ||||
| -rw-r--r-- | django/core/checks/compatibility/__init__.py | 0 | ||||
| -rw-r--r-- | django/core/checks/compatibility/base.py (renamed from django/core/compat_checks/base.py) | 2 | ||||
| -rw-r--r-- | django/core/checks/compatibility/django_1_6_0.py (renamed from django/core/compat_checks/django_1_6_0.py) | 2 | ||||
| -rw-r--r-- | django/core/exceptions.py | 1 | ||||
| -rw-r--r-- | django/core/files/move.py | 4 | ||||
| -rw-r--r-- | django/core/handlers/wsgi.py | 1 | ||||
| -rw-r--r-- | django/core/management/__init__.py | 2 | ||||
| -rw-r--r-- | django/core/management/commands/check.py (renamed from django/core/management/commands/checksetup.py) | 2 | ||||
| -rw-r--r-- | django/core/management/commands/makemessages.py | 6 | ||||
| -rw-r--r-- | django/core/management/templates.py | 2 | ||||
| -rw-r--r-- | django/core/serializers/base.py | 1 |
12 files changed, 12 insertions, 11 deletions
diff --git a/django/core/compat_checks/__init__.py b/django/core/checks/__init__.py index e69de29bb2..e69de29bb2 100644 --- a/django/core/compat_checks/__init__.py +++ b/django/core/checks/__init__.py diff --git a/django/core/checks/compatibility/__init__.py b/django/core/checks/compatibility/__init__.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/django/core/checks/compatibility/__init__.py diff --git a/django/core/compat_checks/base.py b/django/core/checks/compatibility/base.py index e54b50f287..7fe52d2af9 100644 --- a/django/core/compat_checks/base.py +++ b/django/core/checks/compatibility/base.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals import warnings -from django.core.compat_checks import django_1_6_0 +from django.core.checks.compatibility import django_1_6_0 COMPAT_CHECKS = [ diff --git a/django/core/compat_checks/django_1_6_0.py b/django/core/checks/compatibility/django_1_6_0.py index bb0dabedac..1998c5ba77 100644 --- a/django/core/compat_checks/django_1_6_0.py +++ b/django/core/checks/compatibility/django_1_6_0.py @@ -27,7 +27,7 @@ def check_test_runner(): def run_checks(): """ - Required by the ``checksetup`` management command, this returns a list of + Required by the ``check`` management command, this returns a list of messages from all the relevant check functions for this version of Django. """ checks = [ diff --git a/django/core/exceptions.py b/django/core/exceptions.py index 829d6e774e..efec22850b 100644 --- a/django/core/exceptions.py +++ b/django/core/exceptions.py @@ -1,7 +1,6 @@ """ Global Django exception and warning classes. """ -import logging from functools import reduce import operator diff --git a/django/core/files/move.py b/django/core/files/move.py index 4519dedf97..4bd739b4c4 100644 --- a/django/core/files/move.py +++ b/django/core/files/move.py @@ -51,6 +51,10 @@ def file_move_safe(old_file_name, new_file_name, chunk_size = 1024*64, allow_ove return try: + # If the destination file exists and allow_overwrite is False then raise an IOError + if not allow_overwrite and os.access(new_file_name, os.F_OK): + raise IOError("Destination file %s exists and allow_overwrite is False" % new_file_name) + os.rename(old_file_name, new_file_name) return except OSError: diff --git a/django/core/handlers/wsgi.py b/django/core/handlers/wsgi.py index af78d1d269..38d8154ac9 100644 --- a/django/core/handlers/wsgi.py +++ b/django/core/handlers/wsgi.py @@ -103,6 +103,7 @@ class WSGIRequest(http.HttpRequest): content_length = 0 self._stream = LimitedStream(self.environ['wsgi.input'], content_length) self._read_started = False + self.resolver_match = None def _is_secure(self): return 'wsgi.url_scheme' in self.environ and self.environ['wsgi.url_scheme'] == 'https' diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py index 77d5e1b264..8fd46aa759 100644 --- a/django/core/management/__init__.py +++ b/django/core/management/__init__.py @@ -3,13 +3,11 @@ import os import sys from optparse import OptionParser, NO_DEFAULT import imp -import warnings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError, handle_default_options from django.core.management.color import color_style from django.utils.importlib import import_module -from django.utils._os import upath from django.utils import six # For backwards compatibility: get_version() used to be in this module. diff --git a/django/core/management/commands/checksetup.py b/django/core/management/commands/check.py index d37e826757..05f48c82bc 100644 --- a/django/core/management/commands/checksetup.py +++ b/django/core/management/commands/check.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals import warnings -from django.core.compat_checks.base import check_compatibility +from django.core.checks.compatibility.base import check_compatibility from django.core.management.base import NoArgsCommand diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py index 060def5d5a..695cad419b 100644 --- a/django/core/management/commands/makemessages.py +++ b/django/core/management/commands/makemessages.py @@ -402,11 +402,11 @@ class Command(NoArgsCommand): if self.verbosity > 1: self.stdout.write("copying plural forms: %s\n" % m.group('value')) lines = [] - seen = False + found = False for line in msgs.split('\n'): - if not line and not seen: + if not found and (not line or plural_forms_re.search(line)): line = '%s\n' % m.group('value') - seen = True + found = True lines.append(line) msgs = '\n'.join(lines) break diff --git a/django/core/management/templates.py b/django/core/management/templates.py index 893e5c95af..1de508d749 100644 --- a/django/core/management/templates.py +++ b/django/core/management/templates.py @@ -105,7 +105,7 @@ class TemplateCommand(BaseCommand): base_name = '%s_name' % app_or_project base_subdir = '%s_template' % app_or_project base_directory = '%s_directory' % app_or_project - if django.VERSION[-1] == 0: + if django.VERSION[-2] != 'final': docs_version = 'dev' else: docs_version = '%d.%d' % django.VERSION[:2] diff --git a/django/core/serializers/base.py b/django/core/serializers/base.py index 1e78026c40..cd4f7ffb2b 100644 --- a/django/core/serializers/base.py +++ b/django/core/serializers/base.py @@ -3,7 +3,6 @@ Module for abstract serializer/unserializer base classes. """ from django.db import models -from django.utils.encoding import smart_text from django.utils import six class SerializerDoesNotExist(KeyError): |
