From 59f8118c86af7641f23a9f2c2e0812c8b1ba47dd Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Thu, 27 Apr 2017 09:39:56 +0200 Subject: [PATCH] Refs #23919 -- Removed force_text() in Python deserializer needed only on Python 2 --- django/core/serializers/python.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/django/core/serializers/python.py b/django/core/serializers/python.py index 80c8bfe1d26..eea5a5c8cd6 100644 --- a/django/core/serializers/python.py +++ b/django/core/serializers/python.py @@ -6,7 +6,6 @@ other serializers. from collections import OrderedDict from django.apps import apps -from django.conf import settings from django.core.serializers import base from django.db import DEFAULT_DB_ALIAS, models from django.utils.encoding import force_text, is_protected_type @@ -116,11 +115,6 @@ def Deserializer(object_list, *, using=DEFAULT_DB_ALIAS, ignorenonexistent=False # skip fields no longer on model continue - if isinstance(field_value, str): - field_value = force_text( - field_value, options.get("encoding", settings.DEFAULT_CHARSET), strings_only=True - ) - field = Model._meta.get_field(field_name) # Handle M2M relations