Skip to content

Commit

Permalink
avoid errors with python3: the packet data must be in bytes format
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@18430 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 14, 2018
1 parent 210f182 commit 20514a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xpra/server/server_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
CHALLENGE_TIMEOUT = envint("XPRA_CHALLENGE_TIMEOUT", 120)


HTTP_UNSUPORTED = """<head>
HTTP_UNSUPORTED = b"""<head>
<title>Error response</title>
</head>
<body>
Expand Down Expand Up @@ -745,7 +745,7 @@ def new_conn_err(self, conn, sock, socktype, socket_info, network_protocol, msg=
try:
sock.settimeout(1)
#default to plain text:
packet_data = "disconnect: connection failed, %s?\n" % msg
packet_data = b"disconnect: connection failed, %s?\n" % strtobytes(msg)
if network_protocol=="xpra":
#try xpra packet format:
packet_data = pack_one_packet(["disconnect", "invalid protocol for this port"]) or packet_data
Expand Down

0 comments on commit 20514a6

Please sign in to comment.