diff --git a/docs/news.rst b/docs/news.rst index 1812e122..debb4122 100644 --- a/docs/news.rst +++ b/docs/news.rst @@ -1,6 +1,12 @@ Release Notes ============= +**UNRELEASED** + +- Fixed regression introduced in 0.36.0 on Python 2.7 when a custom generator + name was passed as unicode (Scikit-build) + (``TypeError: 'unicode' does not have the buffer interface``) + **0.36.0 (2020-12-01)** - Added official Python 3.9 support diff --git a/src/wheel/bdist_wheel.py b/src/wheel/bdist_wheel.py index 9c9b0a88..80e43d0a 100644 --- a/src/wheel/bdist_wheel.py +++ b/src/wheel/bdist_wheel.py @@ -373,6 +373,11 @@ def run(self): def write_wheelfile(self, wheelfile_base, generator='bdist_wheel (' + wheel_version + ')'): from email.message import Message + + # Workaround for Python 2.7 for when "generator" is unicode + if sys.version_info < (3,) and not isinstance(generator, str): + generator = generator.encode('utf-8') + msg = Message() msg['Wheel-Version'] = '1.0' # of the spec msg['Generator'] = generator