From 0f66dd8214b9221b5d0b3077014f3c6ddc706750 Mon Sep 17 00:00:00 2001 From: Saj Goonatilleke Date: Wed, 25 May 2016 09:46:30 +1000 Subject: [PATCH] Open setup.py in binary mode (#264) Fixes #263. --- pex/installer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pex/installer.py b/pex/installer.py index 80e7e0840..7e9a1529b 100644 --- a/pex/installer.py +++ b/pex/installer.py @@ -32,12 +32,12 @@ def function_wrapper(self, *args, **kw): class InstallerBase(object): - SETUP_BOOTSTRAP_HEADER = "import io, sys" + SETUP_BOOTSTRAP_HEADER = "import sys" SETUP_BOOTSTRAP_MODULE = "sys.path.insert(0, %(path)r); import %(module)s" SETUP_BOOTSTRAP_FOOTER = """ __file__ = 'setup.py' sys.argv[0] = 'setup.py' -exec(compile(io.open(__file__, encoding='utf-8').read().replace('\\r\\n', '\\n'), __file__, 'exec')) +exec(compile(open(__file__, 'rb').read(), __file__, 'exec')) """ class Error(Exception): pass