From 48949cd249b2c699447abd57c4dae2f8898f00f9 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 6 Mar 2018 03:36:16 +0000 Subject: [PATCH] parent: Use 'zip' alias of 'zlib' decoder SSH command size: 448 (-5 bytes) Preamble size: 8941 (no change) NB: The 'zip' alias was absent in Python 3.x, until Python 3.4. This should change be reverted if Python 3.0, 3.2, or 3.3 support is required. --- mitogen/parent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mitogen/parent.py b/mitogen/parent.py index 9a6cae40..873c776c 100644 --- a/mitogen/parent.py +++ b/mitogen/parent.py @@ -340,7 +340,7 @@ class Stream(mitogen.core.Stream): os.environ['ARGV0']=e=sys.executable os.execv(e,['mitogen:CONTEXT_NAME']) os.write(1,'EC0\n') - C=_(sys.stdin.read(PREAMBLE_COMPRESSED_LEN), 'zlib') + C=_(sys.stdin.read(PREAMBLE_COMPRESSED_LEN), 'zip') os.fdopen(W,'w',0).write(C) os.fdopen(w,'w',0).write('PREAMBLE_LEN\n'+C) os.write(1,'EC1\n') @@ -362,7 +362,7 @@ class Stream(mitogen.core.Stream): return [ self.python_path, '-c', 'import codecs;_=codecs.decode;' - 'exec(_(_("%s".encode(),"base64"),"zlib"))' % (encoded,) + 'exec(_(_("%s".encode(),"base64"),"zip"))' % (encoded,) ] def get_preamble(self):