Skip to content

resolve django encoding deprecation warnings #853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions graphene_django/debug/sql/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from time import time

import six
from django.utils.encoding import force_text
from django.utils.encoding import force_str

from .types import DjangoDebugSQL

Expand Down Expand Up @@ -78,7 +78,7 @@ def __init__(self, cursor, db, logger):

def _quote_expr(self, element):
if isinstance(element, six.string_types):
return "'%s'" % force_text(element).replace("'", "''")
return "'%s'" % force_str(element).replace("'", "''")
else:
return repr(element)

Expand All @@ -91,7 +91,7 @@ def _quote_params(self, params):

def _decode(self, param):
try:
return force_text(param, strings_only=True)
return force_str(param, strings_only=True)
except UnicodeDecodeError:
return "(encoded string)"

Expand Down