diff -r 7bfbacdb8b8c distutils2/tests/test_command_install_distinfo.py --- a/distutils2/tests/test_command_install_distinfo.py Sun Dec 23 16:30:35 2012 +0200 +++ b/distutils2/tests/test_command_install_distinfo.py Sun Dec 23 16:44:36 2012 +0200 @@ -190,7 +190,7 @@ self.assertEqual(found, expected) def test_record_unicode(self): - pkg_dir, dist = self.create_dist(name=u'foo\u0430-1.0.dist-info', + pkg_dir, dist = self.create_dist(name=u'foo\u4500-1.0.dist-info', version='1.0') install_dir = self.mkdtemp() @@ -221,12 +221,12 @@ cmd.ensure_finalized() cmd.run() - dist_info = os.path.join(install_dir, u'foo\u0430-1.0.dist-info') + dist_info = os.path.join(install_dir, u'foo\u4500-1.0.dist-info') expected = [] for f in install.get_outputs(): if (f.endswith(('.pyc', '.pyo')) or f == os.path.join( - install_dir, u'foo\u0430-1.0.dist-info', 'RECORD')): + install_dir, u'foo\u4500-1.0.dist-info', 'RECORD')): expected.append([f, '', '']) else: size = os.path.getsize(f) diff -r d328dcd07449 distutils2/tests/test_command_install_distinfo.py --- a/distutils2/tests/test_command_install_distinfo.py Sat Oct 27 13:20:29 2012 -0400 +++ b/distutils2/tests/test_command_install_distinfo.py Sun Dec 23 16:45:36 2012 +0200 @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + """Tests for ``distutils2.command.install_distinfo``. Writing of the RESOURCES file is tested in test_command_install_data. @@ -187,8 +189,8 @@ ] self.assertEqual(found, expected) - def test_record(self): - pkg_dir, dist = self.create_dist(name='foo', + def test_record_unicode(self): + pkg_dir, dist = self.create_dist(name=u'foo\u4500-1.0.dist-info', version='1.0') install_dir = self.mkdtemp() @@ -219,12 +221,12 @@ cmd.ensure_finalized() cmd.run() - dist_info = os.path.join(install_dir, 'foo-1.0.dist-info') + dist_info = os.path.join(install_dir, u'foo\u4500-1.0.dist-info') expected = [] for f in install.get_outputs(): if (f.endswith(('.pyc', '.pyo')) or f == os.path.join( - install_dir, 'foo-1.0.dist-info', 'RECORD')): + install_dir, u'foo\u4500-1.0.dist-info', 'RECORD')): expected.append([f, '', '']) else: size = os.path.getsize(f) @@ -235,7 +237,9 @@ expected.append([f, hash, str(size)]) parsed = [] - with open(os.path.join(dist_info, 'RECORD'), 'r') as f: + + record_file_name = os.path.join(dist_info.encode('utf-8'), b'RECORD') + with open(record_file_name, 'r', encoding='utf-8') as f: reader = csv.reader(f, delimiter=',', lineterminator=os.linesep, quotechar='"')