Skip to content

Commit

Permalink
#640: fix noencode for py3k (PITA)
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@9315 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 12, 2015
1 parent 8660fa6 commit b9e45b5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/xpra/net/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,16 @@ def enable_compressor(self, compressor):

def noencode(self, data):
#just send data as a string for clients that don't understand xpra packet format:
return ": ".join([str(x) for x in data])+"\n", FLAGS_NOHEADER
if sys.version_info[0] >= 3:
import codecs
def b(x):
if type(x)==bytes:
return x
return codecs.latin_1_encode(x)[0]
else:
def b(x): #@DuplicatedSignature
return x
return b(": ".join(str(x) for x in data)+"\n"), FLAGS_NOHEADER


def encode(self, packet_in):
Expand Down

0 comments on commit b9e45b5

Please sign in to comment.