summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/tests/test_create.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-19 16:45:32 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-19 16:45:32 (GMT)
commitdd13dd4bcc27fc77be7590ab0c9bf1c7c883201d (patch)
tree6214edb819cd9f5f47d5ff8142d151f5e6aa2438 /Lib/packaging/tests/test_create.py
parent4c9706bd275134d513c61e07764215a7d0c2302c (diff)
downloadcpython-dd13dd4bcc27fc77be7590ab0c9bf1c7c883201d.zip
cpython-dd13dd4bcc27fc77be7590ab0c9bf1c7c883201d.tar.gz
cpython-dd13dd4bcc27fc77be7590ab0c9bf1c7c883201d.tar.bz2
Issue #12112: packaging reads and writes setup.cfg using UTF-8
Diffstat (limited to 'Lib/packaging/tests/test_create.py')
-rw-r--r--Lib/packaging/tests/test_create.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/packaging/tests/test_create.py b/Lib/packaging/tests/test_create.py
index 9c7a912..42cf34b 100644
--- a/Lib/packaging/tests/test_create.py
+++ b/Lib/packaging/tests/test_create.py
@@ -91,7 +91,7 @@ class CreateTestCase(support.TempdirManager,
def test_convert_setup_py_to_cfg(self):
self.write_file((self.wdir, 'setup.py'),
dedent("""
- # -*- coding: utf-8 -*-
+ # coding: utf-8
from distutils.core import setup
long_description = '''My super Death-scription
@@ -124,12 +124,12 @@ class CreateTestCase(support.TempdirManager,
},
scripts=['my_script', 'bin/run'],
)
- """))
+ """), encoding='utf-8')
sys.stdin.write('y\n')
sys.stdin.seek(0)
main()
- with open(os.path.join(self.wdir, 'setup.cfg')) as fp:
+ with open(os.path.join(self.wdir, 'setup.cfg'), encoding='utf-8') as fp:
lines = set(line.rstrip() for line in fp)
# FIXME don't use sets
@@ -171,7 +171,7 @@ class CreateTestCase(support.TempdirManager,
def test_convert_setup_py_to_cfg_with_description_in_readme(self):
self.write_file((self.wdir, 'setup.py'),
dedent("""
- # -*- coding: utf-8 -*-
+ # coding: utf-8
from distutils.core import setup
with open('README.txt') as fp:
long_description = fp.read()
@@ -191,7 +191,7 @@ class CreateTestCase(support.TempdirManager,
('share/man', ['pyxfoil.1']),
],
)
- """))
+ """), encoding='utf-8')
self.write_file((self.wdir, 'README.txt'),
dedent('''
My super Death-scription
@@ -202,7 +202,7 @@ ho, baby!
sys.stdin.seek(0)
# FIXME Out of memory error.
main()
- with open(os.path.join(self.wdir, 'setup.cfg')) as fp:
+ with open(os.path.join(self.wdir, 'setup.cfg'), encoding='utf-8') as fp:
lines = set(line.rstrip() for line in fp)
self.assertEqual(lines, set(['',