summaryrefslogtreecommitdiff
path: root/django/core
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2016-11-19 18:19:41 +0100
committerClaude Paroz <claude@2xlibre.net>2017-01-18 09:55:19 +0100
commitd7b9aaa366dd54ecc3142c588162e3adc7c2f7ac (patch)
treec7faf11a6f6c14981a08a621c36e6f736b21dd8b /django/core
parent397b3705c5f762b359cdb494f9447c8a60685adf (diff)
Refs #23919 -- Removed encoding preambles and future imports
Diffstat (limited to 'django/core')
-rw-r--r--django/core/cache/backends/base.py2
-rw-r--r--django/core/cache/utils.py2
-rw-r--r--django/core/checks/__init__.py3
-rw-r--r--django/core/checks/caches.py2
-rw-r--r--django/core/checks/messages.py3
-rw-r--r--django/core/checks/model_checks.py3
-rw-r--r--django/core/checks/registry.py3
-rw-r--r--django/core/checks/templates.py3
-rw-r--r--django/core/checks/urls.py2
-rw-r--r--django/core/files/base.py2
-rw-r--r--django/core/files/uploadhandler.py2
-rw-r--r--django/core/handlers/base.py2
-rw-r--r--django/core/handlers/exception.py2
-rw-r--r--django/core/handlers/wsgi.py2
-rw-r--r--django/core/mail/__init__.py2
-rw-r--r--django/core/mail/message.py2
-rw-r--r--django/core/management/__init__.py2
-rw-r--r--django/core/management/base.py3
-rw-r--r--django/core/management/commands/check.py3
-rw-r--r--django/core/management/commands/compilemessages.py2
-rw-r--r--django/core/management/commands/flush.py2
-rw-r--r--django/core/management/commands/inspectdb.py4
-rw-r--r--django/core/management/commands/loaddata.py2
-rw-r--r--django/core/management/commands/makemessages.py2
-rw-r--r--django/core/management/commands/migrate.py3
-rw-r--r--django/core/management/commands/runserver.py2
-rw-r--r--django/core/management/commands/showmigrations.py3
-rw-r--r--django/core/management/commands/sqlflush.py2
-rw-r--r--django/core/management/commands/sqlmigrate.py3
-rw-r--r--django/core/management/commands/sqlsequencereset.py2
-rw-r--r--django/core/management/sql.py2
-rw-r--r--django/core/management/templates.py2
-rw-r--r--django/core/management/utils.py2
-rw-r--r--django/core/serializers/json.py3
-rw-r--r--django/core/serializers/python.py2
-rw-r--r--django/core/serializers/xml_serializer.py2
-rw-r--r--django/core/servers/basehttp.py2
-rw-r--r--django/core/signing.py2
-rw-r--r--django/core/validators.py2
39 files changed, 0 insertions, 91 deletions
diff --git a/django/core/cache/backends/base.py b/django/core/cache/backends/base.py
index 9cbfe0be1d..856316b400 100644
--- a/django/core/cache/backends/base.py
+++ b/django/core/cache/backends/base.py
@@ -1,6 +1,4 @@
"Base Cache class."
-from __future__ import unicode_literals
-
import time
import warnings
diff --git a/django/core/cache/utils.py b/django/core/cache/utils.py
index c40e4eba0c..84676b9237 100644
--- a/django/core/cache/utils.py
+++ b/django/core/cache/utils.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
import hashlib
from django.utils.encoding import force_bytes
diff --git a/django/core/checks/__init__.py b/django/core/checks/__init__.py
index f2194a3fc9..8ef3f5db90 100644
--- a/django/core/checks/__init__.py
+++ b/django/core/checks/__init__.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from .messages import (
CRITICAL, DEBUG, ERROR, INFO, WARNING, CheckMessage, Critical, Debug,
Error, Info, Warning,
diff --git a/django/core/checks/caches.py b/django/core/checks/caches.py
index 4a4141777d..0994a5b0e8 100644
--- a/django/core/checks/caches.py
+++ b/django/core/checks/caches.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from django.conf import settings
from django.core.cache import DEFAULT_CACHE_ALIAS
diff --git a/django/core/checks/messages.py b/django/core/checks/messages.py
index 345ebec1e1..f1de41a63c 100644
--- a/django/core/checks/messages.py
+++ b/django/core/checks/messages.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.utils.encoding import force_str, python_2_unicode_compatible
# Levels
diff --git a/django/core/checks/model_checks.py b/django/core/checks/model_checks.py
index 0c12f9b96a..a8b5652662 100644
--- a/django/core/checks/model_checks.py
+++ b/django/core/checks/model_checks.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import inspect
import types
from itertools import chain
diff --git a/django/core/checks/registry.py b/django/core/checks/registry.py
index 292e0cb73b..4a2b358dc8 100644
--- a/django/core/checks/registry.py
+++ b/django/core/checks/registry.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from itertools import chain
from django.utils.itercompat import is_iterable
diff --git a/django/core/checks/templates.py b/django/core/checks/templates.py
index 098371740e..bf526c871e 100644
--- a/django/core/checks/templates.py
+++ b/django/core/checks/templates.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import copy
from django.conf import settings
diff --git a/django/core/checks/urls.py b/django/core/checks/urls.py
index e950cb5637..d721bc901f 100644
--- a/django/core/checks/urls.py
+++ b/django/core/checks/urls.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from collections import Counter
from django.conf import settings
diff --git a/django/core/files/base.py b/django/core/files/base.py
index be889c9bc4..7499629459 100644
--- a/django/core/files/base.py
+++ b/django/core/files/base.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
import os
from io import BytesIO, StringIO, UnsupportedOperation
diff --git a/django/core/files/uploadhandler.py b/django/core/files/uploadhandler.py
index 05b431d05a..748477c0fc 100644
--- a/django/core/files/uploadhandler.py
+++ b/django/core/files/uploadhandler.py
@@ -2,8 +2,6 @@
Base file upload handler classes, and the built-in concrete subclasses
"""
-from __future__ import unicode_literals
-
from io import BytesIO
from django.conf import settings
diff --git a/django/core/handlers/base.py b/django/core/handlers/base.py
index 1d53fa9d94..b37716b62c 100644
--- a/django/core/handlers/base.py
+++ b/django/core/handlers/base.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
import logging
import types
diff --git a/django/core/handlers/exception.py b/django/core/handlers/exception.py
index ab859405f3..5e489f64d3 100644
--- a/django/core/handlers/exception.py
+++ b/django/core/handlers/exception.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
import logging
import sys
from functools import wraps
diff --git a/django/core/handlers/wsgi.py b/django/core/handlers/wsgi.py
index 4486754d41..538373cd8d 100644
--- a/django/core/handlers/wsgi.py
+++ b/django/core/handlers/wsgi.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
import cgi
import codecs
import re
diff --git a/django/core/mail/__init__.py b/django/core/mail/__init__.py
index 5741f8a829..23beae0cce 100644
--- a/django/core/mail/__init__.py
+++ b/django/core/mail/__init__.py
@@ -1,8 +1,6 @@
"""
Tools for sending email.
"""
-from __future__ import unicode_literals
-
from django.conf import settings
# Imported for backwards compatibility and for the sake
# of a cleaner namespace. These symbols used to be in
diff --git a/django/core/mail/message.py b/django/core/mail/message.py
index 3cebbaf9d2..2c68e82809 100644
--- a/django/core/mail/message.py
+++ b/django/core/mail/message.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
import mimetypes
import os
import random
diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py
index fdc1af2aa2..6b89fff351 100644
--- a/django/core/management/__init__.py
+++ b/django/core/management/__init__.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
import os
import pkgutil
import sys
diff --git a/django/core/management/base.py b/django/core/management/base.py
index cdc673a479..192d529ef0 100644
--- a/django/core/management/base.py
+++ b/django/core/management/base.py
@@ -1,10 +1,7 @@
-# -*- coding: utf-8 -*-
"""
Base classes for writing management commands (named commands which can
be executed through ``django-admin`` or ``manage.py``).
"""
-from __future__ import unicode_literals
-
import os
import sys
from argparse import ArgumentParser
diff --git a/django/core/management/commands/check.py b/django/core/management/commands/check.py
index aa9685caa9..e119960f44 100644
--- a/django/core/management/commands/check.py
+++ b/django/core/management/commands/check.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.apps import apps
from django.core import checks
from django.core.checks.registry import registry
diff --git a/django/core/management/commands/compilemessages.py b/django/core/management/commands/compilemessages.py
index 874fea4b5a..05fb9e5cfc 100644
--- a/django/core/management/commands/compilemessages.py
+++ b/django/core/management/commands/compilemessages.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
import codecs
import glob
import os
diff --git a/django/core/management/commands/flush.py b/django/core/management/commands/flush.py
index 68226355b8..dbe870f322 100644
--- a/django/core/management/commands/flush.py
+++ b/django/core/management/commands/flush.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
import sys
from importlib import import_module
diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py
index 69721b1283..09939f28da 100644
--- a/django/core/management/commands/inspectdb.py
+++ b/django/core/management/commands/inspectdb.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
import keyword
import re
from collections import OrderedDict
@@ -56,8 +54,6 @@ class Command(BaseCommand):
"Django to create, modify, and delete the table"
)
yield "# Feel free to rename the models, but don't rename db_table values or field names."
- yield "from __future__ import unicode_literals"
- yield ''
yield 'from %s import models' % self.db_module
known_models = []
tables_to_introspect = options['table'] or connection.introspection.table_names(cursor)
diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py
index d824011a03..4b621205e6 100644
--- a/django/core/management/commands/loaddata.py
+++ b/django/core/management/commands/loaddata.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
import glob
import gzip
import os
diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
index 527472e1c9..1597f9347e 100644
--- a/django/core/management/commands/makemessages.py
+++ b/django/core/management/commands/makemessages.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
import fnmatch
import glob
import io
diff --git a/django/core/management/commands/migrate.py b/django/core/management/commands/migrate.py
index ea9e7cd46b..79ff872db0 100644
--- a/django/core/management/commands/migrate.py
+++ b/django/core/management/commands/migrate.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
import time
from collections import OrderedDict
from importlib import import_module
diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py
index 0bfbd5b68e..62370072c5 100644
--- a/django/core/management/commands/runserver.py
+++ b/django/core/management/commands/runserver.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
import errno
import os
import re
diff --git a/django/core/management/commands/showmigrations.py b/django/core/management/commands/showmigrations.py
index 890839b150..1e20ec1745 100644
--- a/django/core/management/commands/showmigrations.py
+++ b/django/core/management/commands/showmigrations.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
from django.db.migrations.loader import MigrationLoader
diff --git a/django/core/management/commands/sqlflush.py b/django/core/management/commands/sqlflush.py
index f0c7e30270..da7d6b00e9 100644
--- a/django/core/management/commands/sqlflush.py
+++ b/django/core/management/commands/sqlflush.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from django.core.management.base import BaseCommand
from django.core.management.sql import sql_flush
from django.db import DEFAULT_DB_ALIAS, connections
diff --git a/django/core/management/commands/sqlmigrate.py b/django/core/management/commands/sqlmigrate.py
index 5047d900c1..f6c67a5807 100644
--- a/django/core/management/commands/sqlmigrate.py
+++ b/django/core/management/commands/sqlmigrate.py
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-from __future__ import unicode_literals
-
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
from django.db.migrations.executor import MigrationExecutor
diff --git a/django/core/management/commands/sqlsequencereset.py b/django/core/management/commands/sqlsequencereset.py
index 6ac6e10d60..788a923c72 100644
--- a/django/core/management/commands/sqlsequencereset.py
+++ b/django/core/management/commands/sqlsequencereset.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from django.core.management.base import AppCommand
from django.db import DEFAULT_DB_ALIAS, connections
diff --git a/django/core/management/sql.py b/django/core/management/sql.py
index c72519f30a..3783025900 100644
--- a/django/core/management/sql.py
+++ b/django/core/management/sql.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
from django.apps import apps
from django.db import models
diff --git a/django/core/management/templates.py b/django/core/management/templates.py
index ee6e284a63..805da99148 100644
--- a/django/core/management/templates.py
+++ b/django/core/management/templates.py
@@ -113,8 +113,6 @@ class TemplateCommand(BaseCommand):
camel_case_name: camel_case_value,
'docs_version': get_docs_version(),
'django_version': django.__version__,
- 'unicode_literals': '' if six.PY3 else '# -*- coding: utf-8 -*-\n'
- 'from __future__ import unicode_literals\n\n',
}), autoescape=False)
# Setup a stub settings environment for template rendering
diff --git a/django/core/management/utils.py b/django/core/management/utils.py
index 7ea005a6f0..0fb8b0d25f 100644
--- a/django/core/management/utils.py
+++ b/django/core/management/utils.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
import os
import sys
from subprocess import PIPE, Popen
diff --git a/django/core/serializers/json.py b/django/core/serializers/json.py
index 9da8993ee6..b335605785 100644
--- a/django/core/serializers/json.py
+++ b/django/core/serializers/json.py
@@ -2,9 +2,6 @@
Serialize data to/from JSON
"""
-# Avoid shadowing the standard library json module
-from __future__ import absolute_import, unicode_literals
-
import datetime
import decimal
import json
diff --git a/django/core/serializers/python.py b/django/core/serializers/python.py
index 7a61999f15..a0cea14297 100644
--- a/django/core/serializers/python.py
+++ b/django/core/serializers/python.py
@@ -3,8 +3,6 @@ A Python "serializer". Doesn't do much serializing per se -- just converts to
and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for
other serializers.
"""
-from __future__ import unicode_literals
-
from collections import OrderedDict
from django.apps import apps
diff --git a/django/core/serializers/xml_serializer.py b/django/core/serializers/xml_serializer.py
index 5e151108fc..e209cb286a 100644
--- a/django/core/serializers/xml_serializer.py
+++ b/django/core/serializers/xml_serializer.py
@@ -2,8 +2,6 @@
XML serializer.
"""
-from __future__ import unicode_literals
-
from collections import OrderedDict
from xml.dom import pulldom
from xml.sax import handler
diff --git a/django/core/servers/basehttp.py b/django/core/servers/basehttp.py
index 3928d8c3ff..e27378e7a5 100644
--- a/django/core/servers/basehttp.py
+++ b/django/core/servers/basehttp.py
@@ -7,8 +7,6 @@ This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE!
"""
-from __future__ import unicode_literals
-
import logging
import socket
import sys
diff --git a/django/core/signing.py b/django/core/signing.py
index 22b438315b..f578da6f99 100644
--- a/django/core/signing.py
+++ b/django/core/signing.py
@@ -33,8 +33,6 @@ There are 65 url-safe characters: the 64 used by url-safe base64 and the ':'.
These functions make use of all of them.
"""
-from __future__ import unicode_literals
-
import base64
import datetime
import json
diff --git a/django/core/validators.py b/django/core/validators.py
index 3f777254f4..221f3e0934 100644
--- a/django/core/validators.py
+++ b/django/core/validators.py
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
import os
import re