From 99d9701d3084cc587261b78cc1d7b518d10f2ab1 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 20 Aug 2016 17:31:07 -0400 Subject: Issue #27819: Simply default to gztar for sdist formats by default on all platforms. --- Lib/distutils/command/sdist.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'Lib/distutils/command/sdist.py') diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py index 35a06eb09b..f1b8d91977 100644 --- a/Lib/distutils/command/sdist.py +++ b/Lib/distutils/command/sdist.py @@ -91,9 +91,6 @@ class sdist(Command): 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 @@ class sdist(Command): 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 @@ class sdist(Command): 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: -- cgit v1.2.1 From 6fae08cd104afd15190d836823a0dab7b228d0e6 Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Wed, 31 Aug 2016 08:22:29 +0100 Subject: Closes #27904: Improved logging statements to defer formatting until needed. --- Lib/distutils/command/sdist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/distutils/command/sdist.py') diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py index f1b8d91977..4fd1d4715d 100644 --- a/Lib/distutils/command/sdist.py +++ b/Lib/distutils/command/sdist.py @@ -412,7 +412,7 @@ class sdist(Command): log.info(msg) for file in files: if not os.path.isfile(file): - log.warn("'%s' not a regular file -- skipping" % file) + log.warn("'%s' not a regular file -- skipping", file) else: dest = os.path.join(base_dir, file) self.copy_file(file, dest, link=link) -- cgit v1.2.1