Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

teach distutils "upload" to exit with code != 0 when error occurs #65921

Closed
mdengler mannequin opened this issue Jun 11, 2014 · 14 comments
Closed

teach distutils "upload" to exit with code != 0 when error occurs #65921

mdengler mannequin opened this issue Jun 11, 2014 · 14 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@mdengler
Copy link
Mannequin

mdengler mannequin commented Jun 11, 2014

BPO 21722
Nosy @pitrou, @merwok, @dstufft
Files
  • cpython-patch-Lib-distutils-command-upload.py.patch
  • cpython2-patch-Lib-distutils-command-upload.py.patch
  • cpython-patch-Lib-distutils-command-upload.py.patch
  • cpython2-patch-Lib-distutils-command-upload.py.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2014-06-19.03:15:56.673>
    created_at = <Date 2014-06-11.15:13:10.431>
    labels = ['type-bug', 'library']
    title = 'teach distutils "upload" to exit with code != 0 when error occurs'
    updated_at = <Date 2014-06-19.03:15:56.646>
    user = 'https://bugs.python.org/mdengler'

    bugs.python.org fields:

    activity = <Date 2014-06-19.03:15:56.646>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-06-19.03:15:56.673>
    closer = 'pitrou'
    components = ['Distutils', 'Library (Lib)']
    creation = <Date 2014-06-11.15:13:10.431>
    creator = 'mdengler'
    dependencies = []
    files = ['35581', '35582', '35583', '35584']
    hgrepos = []
    issue_num = 21722
    keywords = ['patch']
    message_count = 14.0
    messages = ['220276', '220277', '220314', '220320', '220321', '220322', '220323', '220324', '220325', '220909', '220946', '220957', '220958', '220959']
    nosy_count = 5.0
    nosy_names = ['pitrou', 'eric.araujo', 'python-dev', 'mdengler', 'dstufft']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue21722'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

    @mdengler
    Copy link
    Mannequin Author

    mdengler mannequin commented Jun 11, 2014

    This patch teaches distutils/command/upload.py to return a non-zero exit code when uploading fails. Currently a zero error code is returned (specifically, no Exception is raised by upload.run(...)) regardless of the HTTP response from the server or any socket error during that conversation.

    Should be applied against tip.

    Thanks.

    @mdengler mdengler mannequin added the stdlib Python modules in the Lib dir label Jun 11, 2014
    @mdengler
    Copy link
    Mannequin Author

    mdengler mannequin commented Jun 11, 2014

    The attached file is a patch for backporting this fix to 2.7.7.

    @ned-deily ned-deily added the stdlib Python modules in the Lib dir label Jun 11, 2014
    @pitrou
    Copy link
    Member

    pitrou commented Jun 11, 2014

    Thanks you for the patch. It may be good to add a unit test for this.
    Also, for development, it is probably better to use a Mercurial clone instead of trying to generate diffs by hand. See the devguide for more information: https://docs.python.org/devguide/

    @mdengler
    Copy link
    Mannequin Author

    mdengler mannequin commented Jun 11, 2014

    Here is the patch against hg tip.

    @mdengler
    Copy link
    Mannequin Author

    mdengler mannequin commented Jun 11, 2014

    Here is the patch against hg 2.7.

    @mdengler
    Copy link
    Mannequin Author

    mdengler mannequin commented Jun 11, 2014

    I will submit patches with tests as soon as the before & after tests finish.

    @mdengler
    Copy link
    Mannequin Author

    mdengler mannequin commented Jun 12, 2014

    Here is the patch against tip, including a new test case.

    @mdengler
    Copy link
    Mannequin Author

    mdengler mannequin commented Jun 12, 2014

    Here is the patch against 2.7, including a new test case.

    @mdengler
    Copy link
    Mannequin Author

    mdengler mannequin commented Jun 12, 2014

    If you'd like me to change anything about the test case please let me know.

    @mdengler
    Copy link
    Mannequin Author

    mdengler mannequin commented Jun 17, 2014

    I've got the contrib form bit now.

    @pitrou
    Copy link
    Member

    pitrou commented Jun 18, 2014

    Thank you Martin. I will take a look soon at the patch.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jun 19, 2014

    New changeset d86214c98a9c by Antoine Pitrou in branch '3.4':
    Issue bpo-21722: The distutils "upload" command now exits with a non-zero return code when uploading fails.
    http://hg.python.org/cpython/rev/d86214c98a9c

    New changeset 979aaa08c067 by Antoine Pitrou in branch 'default':
    Issue bpo-21722: The distutils "upload" command now exits with a non-zero return code when uploading fails.
    http://hg.python.org/cpython/rev/979aaa08c067

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jun 19, 2014

    New changeset cf70f030a744 by Antoine Pitrou in branch '2.7':
    Issue bpo-21722: The distutils "upload" command now exits with a non-zero return code when uploading fails.
    http://hg.python.org/cpython/rev/cf70f030a744

    @pitrou
    Copy link
    Member

    pitrou commented Jun 19, 2014

    I've now committed the fix. Thank you for your contribution!

    @pitrou pitrou closed this as completed Jun 19, 2014
    @pitrou pitrou added the type-bug An unexpected behavior, bug, or error label Jun 19, 2014
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants