Skip to content
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

[FIX] sentry: Fix deprecated usage of text_type #3103

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
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
7 changes: 3 additions & 4 deletions sentry/logutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os.path
import urllib.parse

from sentry_sdk._compat import text_type
from werkzeug import datastructures

from .generalutils import get_environ
Expand Down Expand Up @@ -81,7 +80,7 @@
)

with open(head_path, "r") as fp:
head = text_type(fp.read()).strip()
head = str(fp.read()).strip()

Check warning on line 83 in sentry/logutils.py

View check run for this annotation

Codecov / codecov/patch

sentry/logutils.py#L83

Added line #L83 was not covered by tests

if head.startswith("ref: "):
head = head[5:]
Expand Down Expand Up @@ -110,11 +109,11 @@
except ValueError:
continue
if ref == head:
return text_type(revision)
return str(revision)

Check warning on line 112 in sentry/logutils.py

View check run for this annotation

Codecov / codecov/patch

sentry/logutils.py#L112

Added line #L112 was not covered by tests

raise InvalidGitRepository(
'Unable to find ref to head "%s" in repository' % (head,)
)

with open(revision_file) as fh:
return text_type(fh.read()).strip()
return str(fh.read()).strip()

Check warning on line 119 in sentry/logutils.py

View check run for this annotation

Codecov / codecov/patch

sentry/logutils.py#L119

Added line #L119 was not covered by tests
3 changes: 1 addition & 2 deletions sentry/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import re

from sentry_sdk._compat import text_type

from .generalutils import string_types, varmap

Expand Down Expand Up @@ -53,7 +52,7 @@ def sanitize(self, item, value):
if isinstance(item, bytes):
item = item.decode("utf-8", "replace")
else:
item = text_type(item)
item = str(item)

item = item.lower()
for key in self.sanitize_keys:
Expand Down
Loading