diff --git a/evennia/contrib/base_systems/awsstorage/aws_s3_cdn.py b/evennia/contrib/base_systems/awsstorage/aws_s3_cdn.py index 1123c66f1a..1d7494ab92 100644 --- a/evennia/contrib/base_systems/awsstorage/aws_s3_cdn.py +++ b/evennia/contrib/base_systems/awsstorage/aws_s3_cdn.py @@ -76,7 +76,7 @@ from tempfile import SpooledTemporaryFile from django.core.files.base import File from django.core.files.storage import Storage from django.utils.deconstruct import deconstructible -from django.utils.encoding import filepath_to_uri, force_bytes, force_text, smart_text +from django.utils.encoding import filepath_to_uri, force_bytes, force_str, smart_str from django.utils.timezone import is_naive, make_naive try: @@ -127,9 +127,9 @@ def safe_join(base, *paths): final_path (str): A joined path, base + filepath """ - base_path = force_text(base) + base_path = force_str(base) base_path = base_path.rstrip("/") - paths = [force_text(p) for p in paths] + paths = [force_str(p) for p in paths] final_path = base_path + "/" for path in paths: @@ -252,7 +252,7 @@ class S3Boto3StorageFile(File): self._storage = storage self.name = name[len(self._storage.location) :].lstrip("/") self._mode = mode - self._force_mode = (lambda b: b) if "b" in mode else force_text + self._force_mode = (lambda b: b) if "b" in mode else force_str self.obj = storage.bucket.Object(storage._encode_name(name)) if "w" not in mode: # Force early RAII-style exception if object does not exist @@ -632,10 +632,10 @@ class S3Boto3Storage(Storage): raise SuspiciousOperation("Attempted access to '%s' denied." % name) def _encode_name(self, name): - return smart_text(name, encoding=self.file_name_charset) + return smart_str(name, encoding=self.file_name_charset) def _decode_name(self, name): - return force_text(name, encoding=self.file_name_charset) + return force_str(name, encoding=self.file_name_charset) def _compress_content(self, content): """Gzip a given string content."""