Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/python/mod_python/apache.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@
import stat
import imp
import types
import cgi
import _apache
try:
from html import escape
except:
from cgi import escape

try:
import threading
Expand Down Expand Up @@ -549,7 +552,7 @@ def ReportError(self, etype, evalue, etb, req=None, filter=None, srv=None,

s = '\n<pre>\nMod_python error: "%s %s"\n\n' % (phase, hname)
for e in traceback.format_exception(etype, evalue, etb):
s = s + cgi.escape(e) + '\n'
s = s + escape(e) + '\n'
s = s + "</pre>\n"

if filter:
Expand Down
5 changes: 4 additions & 1 deletion lib/python/mod_python/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ class StringField(bytes):
disp_options = None

def __new__(self, value):
return bytes.__new__(self, str(value), "utf-8")
if PY2:
return bytes.__new__(self, value)
else:
return bytes.__new__(self, str(value), encoding = "utf-8")

def __init__(self, value):
self.value = value
Expand Down
2 changes: 1 addition & 1 deletion src/_apachemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "mod_python.h"

/* A referende to the _apache.SERVER_RETURN */
/* A reference to the _apache.SERVER_RETURN */

PyObject *Mp_ServerReturn;

Expand Down