Fixed SPA decoding error when locale isn't set on system

This commit is contained in:
Agate 2020-04-23 11:14:52 +02:00
parent 46028b43af
commit 9b2f5df4d5
No known key found for this signature in database
GPG Key ID: 6B501DFD73514E14
1 changed files with 2 additions and 2 deletions

View File

@ -101,8 +101,8 @@ def get_spa_file(spa_url, name):
# strip the filename
path = os.path.join(os.path.dirname(spa_url), name)
# we try to open a local file
with open(path) as f:
return f.read()
with open(path, "rb") as f:
return f.read().decode("utf-8")
cache_key = "spa-file:{}:{}".format(spa_url, name)
cached = caches["local"].get(cache_key)
if cached: