summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/metadata.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-19 16:49:56 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-19 16:49:56 (GMT)
commitc3364529b8ac8e8b42e5934aa2c7d687d5074d66 (patch)
tree2d490b2e3b95a4cee45e8d603c48cc39e9f3f9de /Lib/packaging/metadata.py
parentdd13dd4bcc27fc77be7590ab0c9bf1c7c883201d (diff)
downloadcpython-c3364529b8ac8e8b42e5934aa2c7d687d5074d66.zip
cpython-c3364529b8ac8e8b42e5934aa2c7d687d5074d66.tar.gz
cpython-c3364529b8ac8e8b42e5934aa2c7d687d5074d66.tar.bz2
Issue #12112: packaging reads/writes metadata using UTF-8
Diffstat (limited to 'Lib/packaging/metadata.py')
-rw-r--r--Lib/packaging/metadata.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/packaging/metadata.py b/Lib/packaging/metadata.py
index 8abbe38..596eec7 100644
--- a/Lib/packaging/metadata.py
+++ b/Lib/packaging/metadata.py
@@ -307,7 +307,7 @@ class Metadata:
def read(self, filepath):
"""Read the metadata values from a file path."""
- with open(filepath, 'r', encoding='ascii') as fp:
+ with open(filepath, 'r', encoding='utf-8') as fp:
self.read_file(fp)
def read_file(self, fileob):
@@ -330,7 +330,7 @@ class Metadata:
def write(self, filepath):
"""Write the metadata fields to filepath."""
- with open(filepath, 'w') as fp:
+ with open(filepath, 'w', encoding='utf-8') as fp:
self.write_file(fp)
def write_file(self, fileobject):