aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command
diff options
context:
space:
mode:
authorDaniele Esposti <daniele.esposti@gmail.com>2018-06-16 16:05:49 +0200
committerPaul Ganssle <paul@ganssle.io>2018-08-17 09:31:56 -0400
commit8d887526f34f8955d7df257a24e8e8cf9f3f16de (patch)
treea6641dbdbf2023cf60c47b4c038939e3f67dd8f7 /setuptools/command
parent85593de627e9d0076bd3a1ec7215c8c494ccf09a (diff)
downloadexternal_python_setuptools-8d887526f34f8955d7df257a24e8e8cf9f3f16de.tar.gz
external_python_setuptools-8d887526f34f8955d7df257a24e8e8cf9f3f16de.tar.bz2
external_python_setuptools-8d887526f34f8955d7df257a24e8e8cf9f3f16de.zip
Support scripts with unicode content
This also renames the _to_ascii function to better reflect its purpose.
Diffstat (limited to 'setuptools/command')
-rwxr-xr-xsetuptools/command/easy_install.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index 05508ceb..dd17cc13 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -96,7 +96,7 @@ def samefile(p1, p2):
if six.PY2:
- def _to_ascii(s):
+ def _to_bytes(s):
return s
def isascii(s):
@@ -107,8 +107,8 @@ if six.PY2:
return False
else:
- def _to_ascii(s):
- return s.encode('ascii')
+ def _to_bytes(s):
+ return s.encode('utf8')
def isascii(s):
try:
@@ -805,7 +805,7 @@ class easy_install(Command):
if is_script:
body = self._load_template(dev_path) % locals()
script_text = ScriptWriter.get_header(script_text) + body
- self.write_script(script_name, _to_ascii(script_text), 'b')
+ self.write_script(script_name, _to_bytes(script_text), 'b')
@staticmethod
def _load_template(dev_path):