aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/egg_info.py
diff options
context:
space:
mode:
authortarek <none@none>2009-09-20 14:48:47 +0200
committertarek <none@none>2009-09-20 14:48:47 +0200
commitba84419dfc63e5f535faead38ee9fb60306a079c (patch)
treec489fe218f0e43d14f3a9e8f8c14517439d4fde0 /setuptools/command/egg_info.py
parent1219c326683905695fbdf60c22367129075d2f8d (diff)
parent95159c09e5bb2d1dc1f0ccf89ccbe90ecc6871a0 (diff)
downloadexternal_python_setuptools-ba84419dfc63e5f535faead38ee9fb60306a079c.tar.gz
external_python_setuptools-ba84419dfc63e5f535faead38ee9fb60306a079c.tar.bz2
external_python_setuptools-ba84419dfc63e5f535faead38ee9fb60306a079c.zip
merge dance
--HG-- branch : distribute extra : rebase_source : e0fc1e252a506a6a751f9557d4a01580e1cbbdfa
Diffstat (limited to 'setuptools/command/egg_info.py')
-rwxr-xr-xsetuptools/command/egg_info.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index a8315d23..46cdf4e0 100755
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -3,7 +3,7 @@
Create a distribution's .egg-info directory and contents"""
# This module should be kept compatible with Python 2.3
-import os, re
+import os, re, sys
from setuptools import Command
from distutils.errors import *
from distutils import log
@@ -148,6 +148,8 @@ class egg_info(Command):
to the file.
"""
log.info("writing %s to %s", what, filename)
+ if sys.version_info >= (3,):
+ data = data.encode("utf-8")
if not self.dry_run:
f = open(filename, 'wb')
f.write(data)
@@ -351,8 +353,11 @@ def write_file (filename, contents):
"""Create a file with the specified name and write 'contents' (a
sequence of strings without line terminators) to it.
"""
+ contents = "\n".join(contents)
+ if sys.version_info >= (3,):
+ contents = contents.encode("utf-8")
f = open(filename, "wb") # always write POSIX-style manifest
- f.write("\n".join(contents))
+ f.write(contents)
f.close()