summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2012-03-21 16:27:07 +0000
committerMike Gilbert <floppym@gentoo.org>2012-03-21 16:27:07 +0000
commita024d1822d4ed01dab636832091e2d91aed6f14e (patch)
treec98f79dbc78a27e3f3066f0234e8df17e4b9579d /dev-lang/python/files
parentmarked x86 per bug 408993 (diff)
downloadhistorical-a024d1822d4ed01dab636832091e2d91aed6f14e.tar.gz
historical-a024d1822d4ed01dab636832091e2d91aed6f14e.tar.bz2
historical-a024d1822d4ed01dab636832091e2d91aed6f14e.zip
Resolve distutils issue with unicode characters in egg-info files. Patch backported by mgorny. Bug 343721.
Package-Manager: portage-2.2.0_alpha93/cvs/Linux x86_64
Diffstat (limited to 'dev-lang/python/files')
-rw-r--r--dev-lang/python/files/python-3-distutils-egg-utf8.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/dev-lang/python/files/python-3-distutils-egg-utf8.patch b/dev-lang/python/files/python-3-distutils-egg-utf8.patch
new file mode 100644
index 000000000000..d3213f39e9a5
--- /dev/null
+++ b/dev-lang/python/files/python-3-distutils-egg-utf8.patch
@@ -0,0 +1,43 @@
+
+# HG changeset patch
+# User Victor Stinner <victor.stinner@haypocalc.com>
+# Date 1315259096 -7200
+# Node ID fb4d2e6d393e96baac13c4efc216e361bf12c293
+# Parent cb47cf5138a4567718a25d69a79d1c62d13f187c
+Issue #9561: distutils now reads and writes egg-info files using UTF-8
+
+instead of the locale encoding.
+
+diff --git a/Lib/distutils/command/install_egg_info.py b/Lib/distutils/command/install_egg_info.py
+--- a/Lib/distutils/command/install_egg_info.py
++++ b/Lib/distutils/command/install_egg_info.py
+@@ -40,9 +40,8 @@ class install_egg_info(Command):
+ "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
+diff --git a/Lib/distutils/dist.py b/Lib/distutils/dist.py
+--- a/Lib/distutils/dist.py
++++ b/Lib/distutils/dist.py
+@@ -1010,11 +1010,9 @@ class DistributionMetadata:
+ 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.
+