diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-09-05 23:46:05 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-09-05 23:46:05 +0200 |
commit | e01aa53ea61f67418ee14e11289c68992b0f38db (patch) | |
tree | 58fe448923bcf9eb12d28071c54ab68789d69365 /Lib/distutils/dist.py | |
parent | f7fbb7f75b6b8e27c2efaa75d08024b3c5039e71 (diff) | |
parent | a1bea6e10c6177813aab34a0f05c3d531ec8fd66 (diff) | |
download | cpython-git-e01aa53ea61f67418ee14e11289c68992b0f38db.tar.gz |
Merge 3.2: Issue #9561: distutils now reads and writes egg-info files using UTF-8
instead of the locale encoding.
Diffstat (limited to 'Lib/distutils/dist.py')
-rw-r--r-- | Lib/distutils/dist.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/distutils/dist.py b/Lib/distutils/dist.py index 02cd79ba2f..8ca5b6f4f1 100644 --- 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. |