Unable to install a plugin

Bug #525901 reported by Sesivany on 2010-02-22
42
This bug affects 7 people
Affects Status Importance Assigned to Milestone
HPLIP
Undecided
Unassigned
Python
Won't Fix
Unknown
hplip (Ubuntu)
High
Unassigned
python-defaults (Ubuntu)
Undecided
Unassigned

Bug Description

When I was trying to download and install a plugin for HP LaserJet P1006 I got this output:
HP Linux Imaging and Printing System (ver. 3.9.8)
Plugin Download and Install Utility ver. 2.1

Copyright (c) 2001-9 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

/Checking for network connection...
Downloading configuration file from: http://hplip.sf.net/plugin.conf
Checking for network connection...
Downloading plug-in from: http://www.linuxprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-3.9.8-plugin.run
Receiving digital keys: /usr/bin/gpg --no-permission-warning --keyserver pgp.mit.edu --recv-keys 0x9013c005
Verifying archive integrity... All good.
Uncompressing HPLIP 3.9.8 Plugin Self Extracting Archive.................................

HP Linux Imaging and Printing System (ver. 3.9.8)
Plugin Installer ver. 3.0

Copyright (c) 2001-9 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Plug-in version: 3.9.8
Installed HPLIP version: 3.9.8
Number of files to install: 28

Done.

Downloading firmware to device hp:/usb/HP_LaserJet_P1006?serial=AB0EH7C...
Traceback (most recent call last):
  File "/usr/share/hplip/ui4/plugindialog.py", line 338, in NextButton_clicked
    if d.downloadFirmware():
  File "/usr/share/hplip/base/device.py", line 2440, in downloadFirmware
    log.debug("%s bytes downloaded." % utils.commafy(bytes_written))
  File "/usr/share/hplip/base/utils.py", line 365, in commafy
    return unicode(locale.format("%d", val, grouping=True))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 3: ordinal not in range(128)

I'm using Ubuntu 9.10 (64bit) and I didn't have any problems in Ubuntu 9.04 and older. I upgraded HPlip from 3.9.8 (which was in the distro repository) to 3.9.12 and the problem was solved. But all Ubuntu users still have to deal with this bug so it would be great if you fixed the bug in 3.9.8 or made Ubuntu maintainers backport 3.9.12.

Related branches

i was not able to reproduce this by download hplip-3.9.8.tar.gz from www.hplipopensource.com site and by following steps at
http://hplipopensource.com/hplip-web/install/manual/distros/ubuntu.html

when you got this error, at that time is your PC have installed hplip-gui/hplip-data package from your package manager?
Can you please let us know, which packages you have installed from your package manager for 3.9.8?

Thank you for reporting with HPLIP,
Naga Samrat Chowdary.

Sesivany (jiri-eischmann) wrote :

When I got that error I used packages just from my package manager. I simply plugged in the printer and the system told me that the printer needed a proprietary plugin and offered me to download it. It didn't work, then I tried it several times with HPlip-gui and it didn't work either. BTW I'm using 64-bit Ubuntu.
I have installed these packages:
hplip 3.9.8-1ubuntu2
hplip-data 3.9.8-1ubuntu2
hplip-gui 3.9.8-1ubuntu2
python-qt4 4.6-1

Then I installed HPlip (3.9.12) from the source code provided on the website. The installation process uninstalled all hplip packages except for hplip-data and the problem was fixed. If there is no problem with hplip-3.9.8.tar.gz there must be a problem in the package, where else?

Till Kamppeter (till-kamppeter) wrote :

Is this still a problem with Lucid (HPLIP 3.10.2)?

Till Kamppeter (till-kamppeter) wrote :

This seems to be locale-dependent. Can you run

locale

in a terminal window and post the output here? Thanks.

Changed in hplip:
status: New → Incomplete
Sesivany (jiri-eischmann) wrote :

This bug occured in 9.10. But it didn't work in Lucid as well. The problem was not the same, but very similar (see https://bugs.launchpad.net/ubuntu/+source/hplip/+bug/546809). I ran hplip-gui from a terminal and the output in the terminal was the same till the line with Number of files to install, then it just wrote (both in gui and the terminal) that the installation failed and the process exited. Unfortunately, I can't reproduce it again because I installed hplip from upstream and now it works.

BTW this is output given by locale:
LANG=cs_CZ.utf8
LC_CTYPE="cs_CZ.utf8"
LC_NUMERIC="cs_CZ.utf8"
LC_TIME="cs_CZ.utf8"
LC_COLLATE="cs_CZ.utf8"
LC_MONETARY="cs_CZ.utf8"
LC_MESSAGES="cs_CZ.utf8"
LC_PAPER="cs_CZ.utf8"
LC_NAME="cs_CZ.utf8"
LC_ADDRESS="cs_CZ.utf8"
LC_TELEPHONE="cs_CZ.utf8"
LC_MEASUREMENT="cs_CZ.utf8"
LC_IDENTIFICATION="cs_CZ.utf8"
LC_ALL=

Till Kamppeter (till-kamppeter) wrote :

Moved downstream task (from bug #546809 into this bug.

Changed in hplip (Ubuntu):
status: New → Incomplete

it may be because of this.
this bug is available in python 2.5.2 at http://bugs.python.org/issue2522.
while you are installing HPLIP 3.10.2 python version may get upgraded to 2.6.

Thanks!
Naga Samrat Chowdary, Narla.

Till Kamppeter (till-kamppeter) wrote :

The patch attached to http://bugs.python.org/issue2522 is rather small, I suggest that we should apply it to the Python package of Lucid. Adding Python task ...

Dear Python Packager, please apply the small simple patch as otherwise for many users the installation of HP's printer driver plugin will not work under Lucid. If you think that this (small) patch is a too high impact to Lucid, please tell me, in such a case we need to find a workaround in HPLIP.

R. David Murray (rdmurray) wrote :

I don't think issue 2522 has anything to do with the reported problem. That issue dealt with someone calling locale.format in an inappropriate way, and the fix disallows the inappropriate call. The call in the traceback is appropriate, so the fix from 2522 should not affect the code having the problem.

This problem is instead related to this issue: http://bugs.python.org/issue7327. The root problem is that python2's float formatting machinery doesn't know now to handle the Czech no-break-space, which is a multibyte charater. It returns it as if it were normal ascii codepoints, but it isn't. So when 'unicode' tries to convert the presumed ASCII string to unicode, it fails.

As noted in the issue, this isn't going to get fixed in python2. It could be worked around in the code that is using grouping=True by doing this:

      locale.format("%d", val, grouping=True).decode(locale.getpreferredencoding())

Changed in python:
status: Unknown → Fix Released
Changed in python:
status: Fix Released → Unknown
Changed in hplip (Ubuntu):
status: Incomplete → Triaged
Changed in hplip:
status: Incomplete → Confirmed
Changed in python:
status: Unknown → Won't Fix
Changed in hplip (Ubuntu):
milestone: none → ubuntu-10.04
Changed in hplip (Ubuntu):
importance: Undecided → High
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package hplip - 3.10.2-1ubuntu5

---------------
hplip (3.10.2-1ubuntu5) lucid; urgency=low

  [ Till Kamppeter ]
  * debian/patches/make-commafy-correctly-work-with-python-2.dpatch:
    Installation of the proprietary plug-in did not work with some locales
    (LP: #525901).
  * debian/hplip-cups.postinst, debian/hpijs.postinst: Switch back to HPIJS as
    default driver (migrate hpcups queues to HPIJS) as there are new problems
    with hpcups (LP: #553573, LP: #539708, LP: #538031, LP: #405116).

  [ Mark Purcell ]
  * Fix "can't add printer (Printer queue setup failed)" added debian/hplip.NEWS
    - CUPS requires user to be a member of lpadmin group. (Closes: #566692)
  * Add Recommends: avahi-daemon "HP Color Laserjet CM1312nfi" (Closes: #564520)
  * Add bug/presubj to hplip-cups, hplip-gui & hpijs
  * Add hplip-cups.NEWS
  * bug/script provide status message before hp-check
  * Patch hp-check to check for group membership of lp & lpadmin
 -- Till Kamppeter <email address hidden> Fri, 9 Apr 2010 21:26:18 +0200

Changed in hplip (Ubuntu):
status: Triaged → Fix Released

I still have this issue on Lucid because the package that i have and is in the lucid repos is:

hplip 3.10.2-2ubuntu2

The upgrade and dist-upgrade do not download and install the hplip - 3.10.2-1ubuntu5

Any suggestion ... ?

Thank you

Launchpad Janitor (janitor) wrote :

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

Changed in python-defaults (Ubuntu):
status: New → Confirmed
PeterPall (peterpall) wrote :

The problem seems to occur on the current preview version of precise pangolin, too.

Hi PeterPall,

Currently Ubuntu 12.04 v(precise pangolin) is not yet supported by HPLIP. However please let us know some more details of the problem.

Provide log by running following command.
$ sudo hp-plugin -g

Thanks & Regards,
Amarnath

Nikolay Klimkin (spitfire-kun) wrote :

Got the same problem. Here's the log.

Nikolay, your log makes the impression that the firmware got correctly loaded from the Internet and set up on your computer and after that correctly loaded into your printer.

Make sure that your system is completely up to date. We have already issued some printing-related updates.

Please run the commands

sudo /usr/lib/cups/backend/usb
sudo /usr/lib/cups/backend/hp

and post the output here.

Also follow the instructions in "CUPS error_log" and "Capturing print job data on https://wiki.ubuntu.com/DebuggingPrintingProblems.

Nikolay Klimkin (spitfire-kun) wrote :

Well, after those lines comes the same Python error that was described above. The plugin installer gives an error message "Plugin install failed". When I try to print a test page, the device manager claims that the plugin is not installed.

$ sudo /usr/lib/cups/backend/usb
DEBUG: list_devices
DEBUG: libusb_get_device_list=10
$sudo /usr/lib/cups/backend/hp
direct hp "Unknown" "HP Printer (HPLIP)"

Can someone of the HPLIP developers at HP have a look into this? Thanks.

Matthias Klose (doko) wrote :

won't fix for python2.x

Changed in python-defaults (Ubuntu):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

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