1
0
mirror of https://github.com/django/django.git synced 2025-10-25 06:36:07 +00:00

[2.0.x] Refs #29086 -- Doc'd how to detect bytestring mistakes.

Backport of c10cb9716f from master
This commit is contained in:
Tim Graham
2018-01-30 19:58:16 -05:00
parent 14f1c4d435
commit ddc49820f7

View File

@@ -349,7 +349,8 @@ bytestrings and unicode strings. Now that Python 2 support is dropped,
bytestrings should only be encountered around input/output boundaries (handling bytestrings should only be encountered around input/output boundaries (handling
of binary fields or HTTP streams, for example). You might have to update your of binary fields or HTTP streams, for example). You might have to update your
code to limit bytestring usage to a minimum, as Django no longer accepts code to limit bytestring usage to a minimum, as Django no longer accepts
bytestrings in certain code paths. bytestrings in certain code paths. Python's :option:`-b` option may help detect
that mistake in your code.
For example, ``reverse()`` now uses ``str()`` instead of ``force_text()`` to For example, ``reverse()`` now uses ``str()`` instead of ``force_text()`` to
coerce the ``args`` and ``kwargs`` it receives, prior to their placement in coerce the ``args`` and ``kwargs`` it receives, prior to their placement in