Skip to content

Commit

Permalink
[FIX] sentry: Fix deprecated usage of text_type
Browse files Browse the repository at this point in the history
See original migration for reference: getsentry/sentry-python@2d354c7
  • Loading branch information
hnavarro-kernet committed Feb 2, 2025
1 parent 2ffe4e9 commit 039727d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
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 @@ def fetch_git_sha(path, head=None):
)

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 @@ def fetch_git_sha(path, head=None):
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

0 comments on commit 039727d

Please sign in to comment.