This should probably be unicode.

This commit is contained in:
Ralph Bean
2014-04-14 16:53:18 -04:00
parent be3d283903
commit aba75bfec4
2 changed files with 2 additions and 2 deletions

View File

@@ -165,7 +165,7 @@ class WebSocketTest(unittest.TestCase):
def testWSKey(self):
key = ws._create_sec_websocket_key()
self.assert_(key != 24)
self.assert_("¥n".encode('utf-8') not in key)
self.assert_("¥n" not in key)
def testWsUtils(self):
sock = ws.WebSocket()

View File

@@ -232,7 +232,7 @@ _MAX_CHAR_BYTE = (1<<8) -1
def _create_sec_websocket_key():
uid = uuid.uuid4()
return base64.encodestring(uid.bytes).strip()
return base64.encodestring(uid.bytes).decode('utf-8').strip()
_HEADERS_TO_CHECK = {