Running apt-check --package-names returns an unknown error

Bug #1512326 reported by Woody
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
update-notifier (Ubuntu)
Fix Released
High
Brian Murray
Wily
Fix Released
High
Brian Murray
Xenial
Fix Released
High
Brian Murray

Bug Description

When running /usr/lib/update-notifier/apt-check --package-names the following error is returned:

$ /usr/lib/update-notifier/apt-check --package-names
E: Unknown Error: '<class 'TypeError'>' (map() must have at least two arguments.)

What I expected was a list of packages which can be upgraded.

From what I understand, the map function requires 2 arguments, but the list comprehension used is only creating a single argument, which is the package name.

I found if I changed the function

def write_package_names(outstream, cache, depcache):
    " write out package names that change to outstream "
    pkgs = [pkg for pkg in cache.packages if depcache.marked_install(pkg) or
        depcache.marked_upgrade(pkg)]
    outstream.write("\n".join(map([p.name for p in pkgs])))

def write_package_names(outstream, cache, depcache):
    " write out package names that change to outstream "
    pkgs = [pkg for pkg in cache.packages if depcache.marked_install(pkg) or
        depcache.marked_upgrade(pkg)]
    outstream.write("\n".join([p.name for p in pkgs])) #Removed the map() function

Additional info:
$ lsb_release -rd
Description: Ubuntu 15.10
Release: 15.10

$ apt-cache policy update-notifier-common
update-notifier-common:
  Installed: 3.163
  Candidate: 3.163
  Version table:
 *** 3.163 0
        500 http://gb.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages
        100 /var/lib/dpkg/status

Thanks

Dave

Related branches

Revision history for this message
Stephen (1012web) wrote :

I can confirm this bug. I'm also seeing this on my system that I just upgraded to Wily. This problem did not exist prior to the upgrade.

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=15.10
DISTRIB_CODENAME=wily
DISTRIB_DESCRIPTION="Ubuntu 15.10"

I have a cron job that uses apt-check to check for available updates. This bug is breaking it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in update-notifier (Ubuntu):
status: New → Confirmed
tags: added: wily xenial
Changed in update-notifier (Ubuntu Wily):
status: New → Triaged
Changed in update-notifier (Ubuntu Xenial):
status: Confirmed → Triaged
Changed in update-notifier (Ubuntu Wily):
importance: Undecided → High
Changed in update-notifier (Ubuntu Xenial):
importance: Undecided → High
Changed in update-notifier (Ubuntu Xenial):
assignee: nobody → Brian Murray (brian-murray)
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 3.166

---------------
update-notifier (3.166) xenial; urgency=medium

  * data/apt_check.py: resolve crash when running apt-check with
    --package-names, thanks to Launchpad user Woody for the fix.
    (LP: #1512326)

 -- Brian Murray <email address hidden> Wed, 10 Feb 2016 11:57:26 -0800

Changed in update-notifier (Ubuntu Xenial):
status: In Progress → Fix Released
Changed in update-notifier (Ubuntu Wily):
assignee: nobody → Brian Murray (brian-murray)
status: Triaged → In Progress
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Woody, or anyone else affected,

Accepted update-notifier into wily-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-notifier/3.163.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in update-notifier (Ubuntu Wily):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Woody (dave-woodwardmail) wrote :

Have tested version 3.163.1, and can confirm this is fixed.

Thanks

Woody

$ /usr/lib/update-notifier/apt-check --package-names
libavresample-ffmpeg2
gstreamer1.0-plugins-bad-faad
simple-scan
gstreamer1.0-libav
gir1.2-gst-plugins-base-1.0
libgstreamer-plugins-base1.0-0
libpgm-5.1-0
gstreamer1.0-plugins-base
gir1.2-gtk-3.0
gstreamer1.0-x
gstreamer1.0-plugins-ugly-amr

$ dpkg -s update-notifier-common
Package: update-notifier-common
Status: install ok installed
Priority: optional
Section: gnome
Installed-Size: 1372
Maintainer: Michael Vogt <email address hidden>
Architecture: all
Source: update-notifier
Version: 3.163.1

Revision history for this message
Woody (dave-woodwardmail) wrote :

Hi

I can confirm this is fixed.

Thanks

Woody

$ dpkg -s update-notifier-common
Package: update-notifier-common
Status: install ok installed
Priority: optional
Section: gnome
Installed-Size: 1372
Maintainer: Michael Vogt <email address hidden>
Architecture: all
Source: update-notifier
Version: 3.163.1

$ /usr/lib/update-notifier/apt-check --package-names
libavresample-ffmpeg2
gstreamer1.0-plugins-bad-faad
simple-scan
gstreamer1.0-libav
gir1.2-gst-plugins-base-1.0
libgstreamer-plugins-base1.0-0
libpgm-5.1-0

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 3.163.1

---------------
update-notifier (3.163.1) wily-proposed; urgency=medium

  * data/apt_check.py: resolve crash when running apt-check with
    --package-names, thanks to Launchpad user Woody for the fix.
    (LP: #1512326)

 -- Brian Murray <email address hidden> Wed, 10 Feb 2016 14:12:02 -0800

Changed in update-notifier (Ubuntu Wily):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for update-notifier has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.