summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt13
-rw-r--r--setuptools/dist.py5
2 files changed, 16 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index af1d2efc..2bb23165 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,8 +7,17 @@ CHANGES
------
* Issue #303: Make sure the manifest only ever contains UTF-8 in Python 3.
-* Issue #329: Properly close files created by tests for compatibility with Jython.
-* Work around Jython bugs #1980 and #1981.
+* Issue #329: Properly close files created by tests for compatibility with
+ Jython.
+* Work around Jython bugs `#1980 <http://bugs.jython.org/issue1980>`_ and
+ `#1981 <http://bugs.jython.org/issue1981`_.
+* Issue #334: Provide workaround for packages that reference `sys.__stdout__`
+ such as numpy does. This change should address
+ `virtualenv #359 <https://github.com/pypa/virtualenv/issues/359>`_ as long
+ as the system encoding is UTF-8 or the IO encoding is specified in the
+ environment, i.e.::
+
+ PYTHONIOENCODING=utf8 pip install numpy
------
0.6.30
diff --git a/setuptools/dist.py b/setuptools/dist.py
index afac180e..998a4dbe 100644
--- a/setuptools/dist.py
+++ b/setuptools/dist.py
@@ -657,6 +657,11 @@ class Distribution(_Distribution):
if not isinstance(sys.stdout, io.TextIOWrapper):
return _Distribution.handle_display_options(self, option_order)
+ # Don't wrap stdout if utf-8 is already the encoding. Provides
+ # workaround for #334.
+ if sys.stdout.encoding.lower() in ('utf-8', 'utf8'):
+ return _Distribution.handle_display_options(self, option_order)
+
# Print metadata in UTF-8 no matter the platform
encoding = sys.stdout.encoding
errors = sys.stdout.errors