classification
Title: upload: improve display for error messages from gpg
Type: behavior Stage: needs patch
Components: Distutils Versions: Python 3.4, Python 3.3, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: Parimala.Rao, alexis, eric.araujo, illume, tarek, zubin71
Priority: normal Keywords: easy

Created on 2010-01-11 15:22 by illume, last changed 2014-03-19 17:29 by Parimala.Rao.

Files
File name Uploaded Description Edit
patchfix Parimala.Rao, 2014-03-19 17:29 Improved Error message review
Messages (6)
msg97589 - (view) Author: Rene Dudfield (illume) Date: 2010-01-11 15:22
hi,

When using setup.py upload --sign without --identity, gpg can give weird messages.

Rather than this error message:
"""running upload
gpg --detach-sign --local-user gn -a dist/pywebsite-0.1.18pre.tar.gz
gpg: skipped "gn": secret key not available
gpg: signing failed: secret key not available
error: command 'gpg' failed with exit status 2
make: *** [upload] Error 1"""

It might be nicer to also mention using --identity=, as well as a link to the documentation for --sign (url and also the help from "--help upload").

cheers,
msg101630 - (view) Author: Zubin Mithra (zubin71) Date: 2010-03-24 12:25
are you suggesting that a warning stating that 

'--identity has`nt been used'

has to be generated?
msg159660 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-04-29 23:47
We had a look at this bug during a sprint last week.  First, it is reasonable to use --sign without --identity, as gpg will fall back to a default identity (see the description of --local-user and --default-key in the gpg man page).  Second, it looks like you run distutils commands from a script or makefile and you have a bug there (the “skipped "gn"” message looks suspicious, maybe -sign was used instead of --sign and interpreted as -s -i gn).  Finally, even though we thing this is not a bug, we agreed that it would be nicer to print a message to make clear that distutils2 is not broken but shows the error message from gpg on purpose; this may be done during the next sprint.
msg213460 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2014-03-13 20:32
Improving error messages is an acceptable change for stable branches IMO.
msg213943 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2014-03-18 04:52
Notes for contributors:

* Ignore what I said about distutils2, it’s not an active project anymore. This ticket is about distutils in the standard library.

* To test changes, you can run setup.py commands without really uploading stuff to PyPI, there is a special sandbox repository for that: https://wiki.python.org/moin/TestPyPI
msg214114 - (view) Author: Parimala Rao (Parimala.Rao) * Date: 2014-03-19 17:29
This error is seen when there are no secret keys/default keys present for the person running "upload" command.  Hence using --sign does not fall back to default identity.
History
Date User Action Args
2014-03-19 17:29:19Parimala.Raosetfiles: + patchfix
nosy: + Parimala.Rao
messages: + msg214114

2014-03-18 04:52:35eric.araujosetmessages: + msg213943
2014-03-13 20:32:36eric.araujosetmessages: + msg213460
components: + Distutils, - Distutils2
versions: + Python 2.7, Python 3.4, - 3rd party
2012-04-29 23:47:52eric.araujosettitle: improve error message for setup.py upload --sign without --identity -> upload: improve display for error messages from gpg
2012-04-29 23:47:05eric.araujosetversions: + Python 3.3, - Python 3.1, Python 2.7, Python 3.2
nosy: + alexis

messages: + msg159660

assignee: tarek -> eric.araujo
components: - Distutils
2010-11-18 01:56:56eric.araujosetkeywords: + easy
nosy: illume, tarek, eric.araujo, zubin71
title: distutils, better error message for setup.py upload -sign without identity. -> improve error message for setup.py upload --sign without --identity
components: + Distutils2
versions: + 3rd party, - Python 2.6
2010-04-09 00:04:34eric.araujosetnosy: + eric.araujo
2010-03-24 12:25:23zubin71setnosy: + zubin71
messages: + msg101630
2010-01-11 15:31:31brian.curtinsetpriority: normal
stage: needs patch
versions: + Python 2.6, Python 3.1, Python 2.7, Python 3.2
2010-01-11 15:22:33illumecreate