diff options
| author | Benjamin Peterson <benjamin@python.org> | 2011-09-06 11:57:38 (GMT) |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2011-09-06 11:57:38 (GMT) |
| commit | 388c0e2325f606d497ec174a4a6b28c4d352db2c (patch) | |
| tree | 83ab157488dd364de2a26b453c34e6ce7cc29537 /Lib/distutils/dist.py | |
| parent | 6d8f744730c0689d822db1a2425170d7d5d44aca (diff) | |
| parent | 900c292c6b886ad9c693d7e0481dc16398d5071d (diff) | |
| download | cpython-388c0e2325f606d497ec174a4a6b28c4d352db2c.zip cpython-388c0e2325f606d497ec174a4a6b28c4d352db2c.tar.gz cpython-388c0e2325f606d497ec174a4a6b28c4d352db2c.tar.bz2 | |
merge heads
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 02cd79b..8ca5b6f 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. |
