try coverting path from utf8

This commit is contained in:
Martin Green 2022-06-18 22:48:30 +01:00
parent 38d23fd76b
commit 41dfe08d2a

View File

@ -223,7 +223,7 @@ def expopage(request, path):
filetobeopened = os.path.normpath(expowebpath / path) filetobeopened = os.path.normpath(expowebpath / path)
try: try:
return HttpResponse(content=open(filetobeopened, "rb"), content_type=getmimetype(path)) return HttpResponse(content=open(unicode(filetobeopened, 'utf8'), "rb"), content_type=getmimetype(path))
except IOError: except IOError:
return render(request, 'pagenotfound.html', {'path': path}, status="404") return render(request, 'pagenotfound.html', {'path': path}, status="404")