From b38d71f2935ce069f5f1f6b2ccaa7b99c838db67 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 18 Mar 2018 09:59:32 -0400 Subject: Open metadata file with UTF-8 decoding. --- setuptools/tests/test_dist.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/tests/test_dist.py b/setuptools/tests/test_dist.py index 28b46fd3..8d5c9e38 100644 --- a/setuptools/tests/test_dist.py +++ b/setuptools/tests/test_dist.py @@ -2,6 +2,8 @@ from __future__ import unicode_literals +import io + from setuptools import Distribution from setuptools.extern.six.moves.urllib.request import pathname2url from setuptools.extern.six.moves.urllib_parse import urljoin @@ -122,7 +124,7 @@ def test_maintainer_author(name, attrs, tmpdir): dist.metadata.write_pkg_info(fn_s) - with open(str(fn.join('PKG-INFO')), 'r') as f: + with io.open(str(fn.join('PKG-INFO')), 'r', encoding='utf-8') as f: pkg_lines = f.readlines() pkg_lines = [_ for _ in pkg_lines if _] # Drop blank lines -- cgit v1.2.3