]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
BaseHTTPServer is now http.server in Python 3
authorKevin P. Fleming <kevin@km6g.us>
Tue, 17 Nov 2020 02:45:37 +0000 (21:45 -0500)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Wed, 6 Oct 2021 08:13:12 +0000 (10:13 +0200)
(cherry picked from commit 12c2f4d7bf80e72eeb1f33889a39d15931bd22d2)

regression-tests.auth-py/test_LuaRecords.py

index d0ba5ed039117b2a348ceac8d1284e4d308b2ccc..d44bcd4c215a921ce2ffacb64715d381b3525f32 100644 (file)
@@ -8,7 +8,7 @@ import clientsubnetoption
 
 from authtests import AuthTest
 
-from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
+from http.server import BaseHTTPRequestHandler, HTTPServer
 
 class FakeHTTPServer(BaseHTTPRequestHandler):
     def _set_headers(self):
@@ -19,9 +19,9 @@ class FakeHTTPServer(BaseHTTPRequestHandler):
     def do_GET(self):
         self._set_headers()
         if (self.path == '/ping.json'):
-            self.wfile.write('{"ping":"pong"}')
+            self.wfile.write(bytes('{"ping":"pong"}', 'utf-8'))
         else:
-            self.wfile.write("<html><body><h1>hi!</h1><h2>Programming in Lua !</h2></body></html>")
+            self.wfile.write(bytes("<html><body><h1>hi!</h1><h2>Programming in Lua !</h2></body></html>", "utf-8"))
 
     def log_message(self, format, *args):
         return