diff --git a/django/core/files/base.py b/django/core/files/base.py index 63e3ee99a9..2ac662ed7c 100644 --- a/django/core/files/base.py +++ b/django/core/files/base.py @@ -146,15 +146,15 @@ class ContentFile(File): def endswith_cr(line): - """Return True if line (a text or byte string) ends with '\r'.""" + """Return True if line (a text or bytestring) ends with '\r'.""" return line.endswith('\r' if isinstance(line, str) else b'\r') def endswith_lf(line): - """Return True if line (a text or byte string) ends with '\n'.""" + """Return True if line (a text or bytestring) ends with '\n'.""" return line.endswith('\n' if isinstance(line, str) else b'\n') def equals_lf(line): - """Return True if line (a text or byte string) equals '\n'.""" + """Return True if line (a text or bytestring) equals '\n'.""" return line == ('\n' if isinstance(line, str) else b'\n') diff --git a/django/db/backends/postgresql/schema.py b/django/db/backends/postgresql/schema.py index 6c27bdc2ec..f0df8ad570 100644 --- a/django/db/backends/postgresql/schema.py +++ b/django/db/backends/postgresql/schema.py @@ -23,7 +23,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_delete_procedure = 'DROP FUNCTION %(procedure)s(%(param_types)s)' def quote_value(self, value): - # getquoted() returns a quoted byte string of the adapted value. + # getquoted() returns a quoted bytestring of the adapted value. return psycopg2.extensions.adapt(value).getquoted().decode() def _field_indexes_sql(self, model, field): diff --git a/django/utils/safestring.py b/django/utils/safestring.py index dcdaf26171..1afa18d521 100644 --- a/django/utils/safestring.py +++ b/django/utils/safestring.py @@ -25,7 +25,7 @@ class SafeString(str, SafeData): """ def __add__(self, rhs): """ - Concatenating a safe string with another safe byte string or + Concatenating a safe string with another safe bytestring or safe string is safe. Otherwise, the result is no longer safe. """ t = super().__add__(rhs) diff --git a/docs/ref/files/uploads.txt b/docs/ref/files/uploads.txt index 4e843732a1..f67d9c9631 100644 --- a/docs/ref/files/uploads.txt +++ b/docs/ref/files/uploads.txt @@ -145,7 +145,7 @@ Custom file upload handlers **must** define the following methods: Receives a "chunk" of data from the file upload. - ``raw_data`` is a byte string containing the uploaded data. + ``raw_data`` is a bytestring containing the uploaded data. ``start`` is the position in the file where this ``raw_data`` chunk begins. diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt index 7a99a7c6ba..34dd44ef1d 100644 --- a/docs/ref/request-response.txt +++ b/docs/ref/request-response.txt @@ -38,7 +38,7 @@ All attributes should be considered read-only, unless stated otherwise. .. attribute:: HttpRequest.body - The raw HTTP request body as a byte string. This is useful for processing + The raw HTTP request body as a bytestring. This is useful for processing data in different ways than conventional HTML forms: binary images, XML payload etc. For processing conventional form data, use :attr:`HttpRequest.POST`. diff --git a/docs/releases/1.5.txt b/docs/releases/1.5.txt index 62f5e89633..d913d04b48 100644 --- a/docs/releases/1.5.txt +++ b/docs/releases/1.5.txt @@ -500,7 +500,7 @@ Python's copy of version 2.0.9. However, there are some incompatibilities between other versions of ``simplejson``: - While the ``simplejson`` API is documented as always returning unicode - strings, the optional C implementation can return a byte string. This was + strings, the optional C implementation can return a bytestring. This was fixed in Python 2.7. - ``simplejson.JSONEncoder`` gained a ``namedtuple_as_object`` keyword argument in version 2.2. @@ -525,7 +525,7 @@ String types of hasher method parameters If you have written a :ref:`custom password hasher `, your ``encode()``, ``verify()`` or ``safe_summary()`` methods should accept Unicode parameters (``password``, ``salt`` or ``encoded``). If any of the -hashing methods need byte strings, you can use the +hashing methods need bytestrings, you can use the :func:`~django.utils.encoding.force_bytes` utility to encode the strings. Validation of previous_page_number and next_page_number diff --git a/docs/releases/1.7.1.txt b/docs/releases/1.7.1.txt index 19f669f74c..9fa2bdcd10 100644 --- a/docs/releases/1.7.1.txt +++ b/docs/releases/1.7.1.txt @@ -105,7 +105,7 @@ Bugfixes causing ``IntegrityError`` (:ticket:`23611`). * Made :func:`~django.utils.http.urlsafe_base64_decode` return the proper - type (byte string) on Python 3 (:ticket:`23333`). + type (bytestring) on Python 3 (:ticket:`23333`). * :djadmin:`makemigrations` can now serialize timezone-aware values (:ticket:`23365`). diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index fa6e458aaf..01f250e3b0 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -1111,7 +1111,7 @@ Miscellaneous (or 200M, before 1.7.2) to 500M. * ``reverse()`` and ``reverse_lazy()`` now return Unicode strings instead of - byte strings. + bytestrings. * The ``CacheClass`` shim has been removed from all cache backends. These aliases were provided for backwards compatibility with Django 1.3.