]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Decode StreamRequestHandler read for python3
authorMasashi Honma <masashi.honma@gmail.com>
Mon, 4 Feb 2019 00:39:10 +0000 (02:39 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 4 Feb 2019 10:26:34 +0000 (12:26 +0200)
WPSAPHTTPServer class needs to explicitly decode the read value from
a bytes object to a str object.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
tests/hwsim/test_ap_wps.py

index 0aec63d111bd14c767755c16345c91e55123c475..0a169def8a1ec62ff69be34a8951e3425524db30 100644 (file)
@@ -4107,10 +4107,10 @@ def gen_wps_event(sid='uuid:7eb3342a-8a5f-47fe-a585-0785bfec6d8a'):
 
 class WPSAPHTTPServer(StreamRequestHandler):
     def handle(self):
-        data = self.rfile.readline().strip()
+        data = self.rfile.readline().decode().strip()
         logger.info("HTTP server received: " + data)
         while True:
-            hdr = self.rfile.readline().strip()
+            hdr = self.rfile.readline().decode().strip()
             if len(hdr) == 0:
                 break
             logger.info("HTTP header: " + hdr)