+v38.2.1
+-------
+
+* #1212: fix encoding handling of metadata when installing
+ from a wheel.
+
v38.2.0
-------
[bumpversion]
-current_version = 38.2.0
+current_version = 38.2.1
commit = True
tag = True
setup_params = dict(
name="setuptools",
- version="38.2.0",
+ version="38.2.1",
description="Easily download, build, install, upgrade, and uninstall "
"Python packages",
author="Python Packaging Authority",
import os
+from pkg_resources.extern.six import binary_type
import pkg_resources.py31compat
pkg_resources.py31compat.makedirs(full_name, exist_ok=True)
build_files(contents, prefix=full_name)
else:
- with open(full_name, 'w') as f:
- f.write(contents)
+ if isinstance(contents, binary_type):
+ with open(full_name, 'wb') as f:
+ f.write(contents)
+ else:
+ with open(full_name, 'w') as f:
+ f.write(contents)
+# -*- coding: utf-8 -*-
+
"""wheel tests
"""
@contextlib.contextmanager
def build_wheel(extra_file_defs=None, **kwargs):
file_defs = {
- 'setup.py': DALS(
+ 'setup.py': (DALS(
'''
+ # -*- coding: utf-8 -*-
from setuptools import setup
import setuptools
setup(**%r)
'''
- ) % kwargs,
+ ) % kwargs).encode('utf-8'),
}
if extra_file_defs:
file_defs.update(extra_file_defs)
),
dict(
+ id='utf-8',
+ setup_kwargs=dict(
+ description='Description accentuée',
+ )
+ ),
+
+ dict(
id='data',
file_defs={
'data.txt': DALS(
import zipfile
from pkg_resources import Distribution, PathMetadata, parse_version
+from pkg_resources.extern.six import PY3
from setuptools import Distribution as SetuptoolsDistribution
from setuptools import pep425tags
from setuptools.command.egg_info import write_requirements
dist_data = '%s.data' % dist_basename
def get_metadata(name):
with zf.open('%s/%s' % (dist_info, name)) as fp:
- value = fp.read().decode('utf-8')
+ value = fp.read().decode('utf-8') if PY3 else fp.read()
return email.parser.Parser().parsestr(value)
wheel_metadata = get_metadata('WHEEL')
dist_metadata = get_metadata('METADATA')