summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2001-12-18 20:13:40 (GMT)
committerThomas Heller <theller@ctypes.org>2001-12-18 20:13:40 (GMT)
commitc7cb9ed35f878d6ac31c5b746f8b15abcc3be54d (patch)
tree16de2b02185c846068a3269e419e8be9405a115f /Lib
parent4b1b3bfac11297e158541cd48684bb5456a389cf (diff)
downloadcpython-c7cb9ed35f878d6ac31c5b746f8b15abcc3be54d.zip
cpython-c7cb9ed35f878d6ac31c5b746f8b15abcc3be54d.tar.gz
cpython-c7cb9ed35f878d6ac31c5b746f8b15abcc3be54d.tar.bz2
Second part of fix for bug [#483982] Python 2.2b2 bdist_wininst
crashes. If no external zip-utility is found, the archive is created by the zipfile module, which behaves different now than in 2.1: if the zip-file is created in the root directory if the distribution, it will contain an (empty) version of itself. This triggered the above bug - so it's better to create the zip-file far away in the TMP directory.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/command/bdist_wininst.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/distutils/command/bdist_wininst.py b/Lib/distutils/command/bdist_wininst.py
index 357ba51..9ff9461 100644
--- a/Lib/distutils/command/bdist_wininst.py
+++ b/Lib/distutils/command/bdist_wininst.py
@@ -112,13 +112,16 @@ class bdist_wininst (Command):
# And make an archive relative to the root of the
# pseudo-installation tree.
+ from tempfile import mktemp
+ archive_basename = mktemp()
fullname = self.distribution.get_fullname()
- archive_basename = os.path.join(self.bdist_dir,
- "%s.win32" % fullname)
-
arcname = self.make_archive(archive_basename, "zip",
root_dir=self.bdist_dir)
+ # create an exe containing the zip-file
self.create_exe(arcname, fullname, self.bitmap)
+ # remove the zip-file again
+ self.announce("removing temporary file '%s'" % arcname)
+ os.remove(arcname)
if not self.keep_temp:
remove_tree(self.bdist_dir, self.verbose, self.dry_run)