Skip to content

Commit

Permalink
Update to python 3.7 syntax (django.utils.encoding)
Browse files Browse the repository at this point in the history
  • Loading branch information
Razvan Nesiu committed May 31, 2019
1 parent e3b21d0 commit 3436615
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions django_google_storage/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.conf import settings
from django.core.files.storage import Storage
from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation
from django.utils.encoding import force_unicode, smart_str
from django.utils.encoding import force_text, smart_bytes

from .format import SubdomainCallingFormat
from .file import GSBotoStorageFile
Expand Down Expand Up @@ -126,10 +126,10 @@ def _normalize_name(self, name):
raise SuspiciousOperation("Attempted access to '%s' denied." % name)

def _encode_name(self, name):
return smart_str(name, encoding=self.file_name_charset)
return smart_bytes(name, encoding=self.file_name_charset)

def _decode_name(self, name):
return force_unicode(name, encoding=self.file_name_charset)
return force_text(name, encoding=self.file_name_charset)

def _open(self, name, mode='rb'):
name = self._normalize_name(self._clean_name(name))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='django-google-storage-updated',
version='0.5.1',
version='0.5.2',
packages=['django_google_storage', ],
author='Maxim Smirnoff',
author_email='[email protected]',
Expand Down

0 comments on commit 3436615

Please sign in to comment.