[Python-checkins] Improve error message for "setup.py upload" without dist files (GH-21060)

Miss Islington (bot) webhook-mailer at python.org
Sun Feb 18 23:14:30 EST 2018


https://github.com/python/cpython/commit/2a93fae8b5b26cbfef6c8afb702d305d3919de85
commit: 2a93fae8b5b26cbfef6c8afb702d305d3919de85
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-02-18T20:14:27-08:00
summary:

Improve error message for "setup.py upload" without dist files (GH-21060)

(cherry picked from commit 08a6926b2584040fe3c3f06263b0b5f1fbbdc24c)

Co-authored-by: Éric Araujo <merwok at netwok.org>

files:
A Misc/NEWS.d/next/Library/2018-02-17-19-20-19.bpo-21060.S1Z-x6.rst
M Lib/distutils/command/upload.py

diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py
index f7752f9d12c7..32dda359badb 100644
--- a/Lib/distutils/command/upload.py
+++ b/Lib/distutils/command/upload.py
@@ -57,7 +57,8 @@ def finalize_options(self):
 
     def run(self):
         if not self.distribution.dist_files:
-            msg = "No dist file created in earlier command"
+            msg = ("Must create and upload files in one command "
+                   "(e.g. setup.py sdist upload)")
             raise DistutilsOptionError(msg)
         for command, pyversion, filename in self.distribution.dist_files:
             self.upload_file(command, pyversion, filename)
diff --git a/Misc/NEWS.d/next/Library/2018-02-17-19-20-19.bpo-21060.S1Z-x6.rst b/Misc/NEWS.d/next/Library/2018-02-17-19-20-19.bpo-21060.S1Z-x6.rst
new file mode 100644
index 000000000000..4e0a11362086
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2018-02-17-19-20-19.bpo-21060.S1Z-x6.rst
@@ -0,0 +1,3 @@
+Rewrite confusing message from setup.py upload from
+"No dist file created in earlier command" to the more helpful
+"Must create and upload files in one command".



More information about the Python-checkins mailing list