add-apt-repository traceback when hitting ctrl-c

Bug #1704508 reported by Jeff Lane 
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Fix Released
Medium
Brian Murray

Bug Description

add-apt-repository says to hit ctrl-c to cancel adding a PPA. Then it tracebacks when you do:

ubuntu@bysen:~$ sudo add-apt-repository ppa:maas/next
 This PPA holds new upstream development releases, usually development releases. Currently, it is holding the 2.2 series.
 More info: https://launchpad.net/~maas/+archive/ubuntu/next
Press [ENTER] to continue or ctrl-c to cancel adding it
^CTraceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 143, in <module>
    sys.stdin.readline()
KeyboardInterrupt

I understand why the trace is generated, but this is ugly (users should never see tracebacks for known conditions, IMO).

The KeyboardInterrupt exception should be handled properly like any other exception.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: software-properties-common 0.96.20.7
ProcVersionSignature: User Name 4.4.0-83.106-generic 4.4.70
Uname: Linux 4.4.0-83-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.9
Architecture: amd64
Date: Fri Jul 14 23:17:57 2017
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: software-properties
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Jeff Lane  (bladernr) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in software-properties (Ubuntu):
status: New → Confirmed
Revision history for this message
Yeison Valero (yeisonvalero031) wrote :

I made it to handle and siltent that traceback.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Silent the exception raised when user press ctrl-c" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in software-properties (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Medium
Changed in software-properties (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Brian Murray (brian-murray)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-properties - 0.96.24.16

---------------
software-properties (0.96.24.16) artful; urgency=medium

  * add-apt-repository: Don't raise a Traceback when Ctrl-c is used to cancel
    an operation. Thanks to Launchpad user Yeison Valero fo the initial patch.
    (LP: #1704508)

 -- Brian Murray <email address hidden> Wed, 06 Sep 2017 15:36:51 -0700

Changed in software-properties (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.