summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.rst5
-rwxr-xr-xsetuptools/command/easy_install.py5
2 files changed, 8 insertions, 2 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index 737cc0f8..b64edc61 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,3 +1,8 @@
+v38.5.0
+-------
+
+* #1246: ``easy_install`` now always writes scripts out in UTF-8.
+
v38.4.0
-------
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index b7396b85..7f8c54dd 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -828,14 +828,15 @@ class easy_install(Command):
target = os.path.join(self.script_dir, script_name)
self.add_output(target)
- if not self.dry_run:
+ if self.dry_run:
return
mask = current_umask()
ensure_directory(target)
if os.path.exists(target):
os.unlink(target)
- with open(target, "w" + mode) as f:
+ encoding = 'utf-8' if mode == 't' else None
+ with io.open(target, "w" + mode, encoding=encoding) as f:
f.write(contents)
chmod(target, 0o777 - mask)