[Python-checkins] cpython: Issue #27819: Simply default to gztar for sdist formats by default on all

jason.coombs python-checkins at python.org
Sat Aug 20 17:31:13 EDT 2016


https://hg.python.org/cpython/rev/8d09ec0ee934
changeset:   102808:8d09ec0ee934
user:        Jason R. Coombs <jaraco at jaraco.com>
date:        Sat Aug 20 17:31:07 2016 -0400
summary:
  Issue #27819: Simply default to gztar for sdist formats by default on all platforms.

files:
  Lib/distutils/command/sdist.py |  12 +-----------
  Misc/NEWS                      |   3 +++
  2 files changed, 4 insertions(+), 11 deletions(-)


diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py
--- a/Lib/distutils/command/sdist.py
+++ b/Lib/distutils/command/sdist.py
@@ -91,9 +91,6 @@
     negative_opt = {'no-defaults': 'use-defaults',
                     'no-prune': 'prune' }
 
-    default_format = {'posix': 'gztar',
-                      'nt': 'zip' }
-
     sub_commands = [('check', checking_metadata)]
 
     def initialize_options(self):
@@ -110,7 +107,7 @@
         self.manifest_only = 0
         self.force_manifest = 0
 
-        self.formats = None
+        self.formats = ['gztar']
         self.keep_temp = 0
         self.dist_dir = None
 
@@ -126,13 +123,6 @@
             self.template = "MANIFEST.in"
 
         self.ensure_string_list('formats')
-        if self.formats is None:
-            try:
-                self.formats = [self.default_format[os.name]]
-            except KeyError:
-                raise DistutilsPlatformError(
-                      "don't know how to create source distributions "
-                      "on platform %s" % os.name)
 
         bad_format = archive_util.check_archive_formats(self.formats)
         if bad_format:
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -20,6 +20,9 @@
 Library
 -------
 
+- Issue #27819: In distutils sdists, simply produce the "gztar" (gzipped tar
+  format) distributions on all platforms unless "formats" is supplied.
+
 - Issue #2466: posixpath.ismount now correctly recognizes mount points which
   the user does not have permission to access.
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list