Now the servers locale is utf8, try opening files spectifying path using a text string

This commit is contained in:
Martin Green 2022-06-22 08:52:04 +01:00
parent f0a9c33795
commit 836387057a

View File

@ -226,7 +226,7 @@ def expopage(request, path):
filetobeopened = os.path.normpath(expowebpath / path)
try:
content = open(filetobeopened.encode(sysdefaultencoding), "rb")
content = open(filetobeopened, "rb")
content_type=getmimetype(path)
return HttpResponse(content = content, content_type=content_type)
except IOError: