diff --git a/core/views/expo.py b/core/views/expo.py index 5c0549f..18d21a3 100644 --- a/core/views/expo.py +++ b/core/views/expo.py @@ -282,8 +282,8 @@ def editexpopage(request, path): try: filepath = Path(settings.EXPOWEB) / path - o = open(os.path.normpath(filepath).encode(sysdefaultencoding), "r") - html = o.read(encoding="utf8") + o = open(os.path.normpath(filepath).encode(sysdefaultencoding), "r", encoding="utf8") + html = o.read() autogeneratedmatch = re.search(r"\<\!--\s*(.*?(Do not edit|It is auto-generated).*?)\s*--\>", html, re.DOTALL + re.IGNORECASE) if autogeneratedmatch: return HttpResponse(autogeneratedmatch.group(1))