Kaydet (Commit) e01aa53e authored tarafından Victor Stinner's avatar Victor Stinner

Merge 3.2: Issue #9561: distutils now reads and writes egg-info files using UTF-8

instead of the locale encoding.
...@@ -40,9 +40,8 @@ class install_egg_info(Command): ...@@ -40,9 +40,8 @@ class install_egg_info(Command):
"Creating "+self.install_dir) "Creating "+self.install_dir)
log.info("Writing %s", target) log.info("Writing %s", target)
if not self.dry_run: if not self.dry_run:
f = open(target, 'w') with open(target, 'w', encoding='UTF-8') as f:
self.distribution.metadata.write_pkg_file(f) self.distribution.metadata.write_pkg_file(f)
f.close()
def get_outputs(self): def get_outputs(self):
return self.outputs return self.outputs
......
...@@ -1010,11 +1010,9 @@ class DistributionMetadata: ...@@ -1010,11 +1010,9 @@ class DistributionMetadata:
def write_pkg_info(self, base_dir): def write_pkg_info(self, base_dir):
"""Write the PKG-INFO file into the release tree. """Write the PKG-INFO file into the release tree.
""" """
pkg_info = open(os.path.join(base_dir, 'PKG-INFO'), 'w') with open(os.path.join(base_dir, 'PKG-INFO'), 'w',
try: encoding='UTF-8') as pkg_info:
self.write_pkg_file(pkg_info) self.write_pkg_file(pkg_info)
finally:
pkg_info.close()
def write_pkg_file(self, file): def write_pkg_file(self, file):
"""Write the PKG-INFO format data to a file object. """Write the PKG-INFO format data to a file object.
......
...@@ -271,6 +271,9 @@ Core and Builtins ...@@ -271,6 +271,9 @@ Core and Builtins
Library Library
------- -------
- Issue #9561: distutils now reads and writes egg-info files using UTF-8,
instead of the locale encoding.
- Issue #8286: The distutils command sdist will print a warning message instead - Issue #8286: The distutils command sdist will print a warning message instead
of crashing when an invalid path is given in the manifest template. of crashing when an invalid path is given in the manifest template.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment