summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/tests/support.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/support.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/support.py')
-rw-r--r--Lib/packaging/tests/support.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/packaging/tests/support.py b/Lib/packaging/tests/support.py
index dbd8683..329b755 100644
--- a/Lib/packaging/tests/support.py
+++ b/Lib/packaging/tests/support.py
@@ -138,7 +138,7 @@ class TempdirManager:
d = tempfile.mkdtemp(dir=self._basetempdir)
return d
- def write_file(self, path, content='xxx'):
+ def write_file(self, path, content='xxx', encoding=None):
"""Write a file at the given path.
path can be a string, a tuple or a list; if it's a tuple or list,
@@ -146,7 +146,7 @@ class TempdirManager:
"""
if isinstance(path, (list, tuple)):
path = os.path.join(*path)
- with open(path, 'w') as f:
+ with open(path, 'w', encoding=encoding) as f:
f.write(content)
def create_dist(self, **kw):