instead of the locale encoding.
"Creating "+self.install_dir)
log.info("Writing %s", target)
if not self.dry_run:
- f = open(target, 'w')
- self.distribution.metadata.write_pkg_file(f)
- f.close()
+ with open(target, 'w', encoding='UTF-8') as f:
+ self.distribution.metadata.write_pkg_file(f)
def get_outputs(self):
return self.outputs
def write_pkg_info(self, base_dir):
"""Write the PKG-INFO file into the release tree.
"""
- pkg_info = open(os.path.join(base_dir, 'PKG-INFO'), 'w')
- try:
+ with open(os.path.join(base_dir, 'PKG-INFO'), 'w',
+ encoding='UTF-8') as pkg_info:
self.write_pkg_file(pkg_info)
- finally:
- pkg_info.close()
def write_pkg_file(self, file):
"""Write the PKG-INFO format data to a file object.
Library
-------
+- Issue #9561: distutils now reads and writes egg-info files using UTF-8,
+ instead of the locale encoding.
+
- Issue #12888: Fix a bug in HTMLParser.unescape that prevented it to escape
more than 128 entities. Patch by Peter Otten.
Library
-------
-
+
- Issue #8286: The distutils command sdist will print a warning message instead
of crashing when an invalid path is given in the manifest template.