diff --git a/www/conservancy/__init__.py b/www/conservancy/__init__.py index 844bdf38c4497c12ffcf2e958e64c72652b9ee81..e900952d54630a036e53a900a39b9f1d45e344a8 100644 --- a/www/conservancy/__init__.py +++ b/www/conservancy/__init__.py @@ -13,7 +13,7 @@ class ParameterValidator(object): self.given_hash = given_hash_or_params else: self.given_hash = given_hash_or_params.get(params_hash_key) - seed = getattr(settings, 'CONSERVANCY_SECRET_KEY', '') + seed = getattr(settings, 'CONSERVANCY_SECRET_KEY', '').encode('utf-8') self.hasher = hashlib.sha256(seed) if isinstance(self.given_hash, basestring): self.hash_type = type(self.given_hash) diff --git a/www/conservancy/static/views.py b/www/conservancy/static/views.py index 5ff7aba221bc730e2bcf7707d54976fd519c9788..2da8ff8a588571813335138cae910382d0b54955 100644 --- a/www/conservancy/static/views.py +++ b/www/conservancy/static/views.py @@ -32,12 +32,7 @@ def index(request, *args, **kwargs): path = request.path.lstrip(u'/') if path.endswith(u'/'): path += u'index.html' - try: - path_bytes = path.encode(FILESYSTEM_ENCODING) - except UnicodeEncodeError: - # If the path can't be expressed on the filesystem, it must not exist. - return handler404(request) - fullpath = os.path.join(STATIC_ROOT, path_bytes) + fullpath = os.path.join(STATIC_ROOT, path) if not os.path.exists(fullpath): return handler404(request) content_type, _ = mimetypes.guess_type(path)