From e5dce7b0fbd2965e524ce97114f501319ec2bb6f Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Mon, 17 Apr 2017 14:22:00 +0200 Subject: [PATCH] Refs #27795 -- Removed unneeded force_text calls from the Oracle backend. --- django/db/backends/oracle/base.py | 2 +- django/db/backends/oracle/introspection.py | 3 +-- django/db/backends/oracle/operations.py | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py index 8572aeaae3..0f3ca46d98 100644 --- a/django/db/backends/oracle/base.py +++ b/django/db/backends/oracle/base.py @@ -451,7 +451,7 @@ class FormatStylePlaceholderCursor: # Handle params as sequence args = [(':arg%d' % i) for i in range(len(params))] query = query % tuple(args) - return force_text(query, self.charset), self._format_params(params) + return query, self._format_params(params) def execute(self, query, params=None): query, params = self._fix_for_params(query, params, unify_by_values=True) diff --git a/django/db/backends/oracle/introspection.py b/django/db/backends/oracle/introspection.py index 16dfc46d2c..03f5cd64a0 100644 --- a/django/db/backends/oracle/introspection.py +++ b/django/db/backends/oracle/introspection.py @@ -6,7 +6,6 @@ from django.db.backends.base.introspection import ( BaseDatabaseIntrospection, FieldInfo, TableInfo, ) from django.utils.deprecation import RemovedInDjango21Warning -from django.utils.encoding import force_text class DatabaseIntrospection(BaseDatabaseIntrospection): @@ -75,7 +74,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): self.cache_bust_counter)) description = [] for desc in cursor.description: - name = force_text(desc[0]) # cx_Oracle always returns a 'str' + name = desc[0] internal_size, default = field_map[name] name = name % {} # cx_Oracle, for some reason, doubles percent signs. description.append(FieldInfo(*( diff --git a/django/db/backends/oracle/operations.py b/django/db/backends/oracle/operations.py index bf9834d1f8..daf8007273 100644 --- a/django/db/backends/oracle/operations.py +++ b/django/db/backends/oracle/operations.py @@ -6,7 +6,7 @@ from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations from django.db.backends.utils import strip_quotes, truncate_name from django.utils import timezone -from django.utils.encoding import force_bytes, force_text +from django.utils.encoding import force_bytes from .base import Database from .utils import BulkInsertMapper, InsertIdVar, Oracle_datetime @@ -182,7 +182,7 @@ WHEN (new.%(col_name)s IS NULL) def convert_textfield_value(self, value, expression, connection, context): if isinstance(value, Database.LOB): - value = force_text(value.read()) + value = value.read() return value def convert_binaryfield_value(self, value, expression, connection, context): @@ -277,7 +277,7 @@ WHEN (new.%(col_name)s IS NULL) def process_clob(self, value): if value is None: return '' - return force_text(value.read()) + return value.read() def quote_name(self, name): # SQL92 requires delimited (quoted) names to be case-sensitive. When