summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/tests/support.py
diff options
context:
space:
mode:
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):