`hp-check -t` fails with non-English locale

Bug #1577211 reported by Stefan Löffler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HPLIP
New
Undecided
Unassigned

Bug Description

Output of `locale`:
LANG=de_DE.UTF-8
LANGUAGE=de_DE:en
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=

Output of `lpstat -pXerox-Phaser-8560` [note the non-ASCII "ä" in "Mär"]:
printer Xerox-Phaser-8560 is idle. enabled since Mi 02 Mär 2016 18:35:32 CET

Output of `hp-check -t` (truncated):
Saving output in log file: /home/stefan/hp-check.log

HP Linux Imaging and Printing System (ver. 3.16.3)
Dependency/Version Check Utility ver. 15.1

...

Xerox-Phaser-8560
-----------------
Type: Unknown
Device URI: socket://130.113.54.232:9100
PPD: /etc/cups/ppd/Xerox-Phaser-8560.ppd
PPD Description: Xerox Phaser 8560DN
Printer status: printer Xerox-Phaser-8560 is idle. enabled since Mi 02 Mär 2016 18:35:32 CET
Traceback (most recent call last):
  File "/usr/bin/hp-check", line 856, in <module>
    num_errors, num_warns = core.validate(time_flag, is_quiet_mode)
  File "/usr/bin/hp-check", line 518, in validate
    log.info("Printer status: %s" % output.replace("\n", ""))
  File "/usr/share/hplip/base/logger.py", line 304, in info
    self.log_to_file("%s[%d]: info: :%s" % (self.module, self.pid, message))
  File "/usr/share/hplip/base/logger.py", line 211, in log_to_file
    self._log_file_f.write(message.replace('\x1b', ''))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 96: ordinal not in range(128)

Output of `lsb_release -a`:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.04
Release: 15.04
Codename: vivid

NB: Running `LANG=en lpstat -pXerox-Phaser-8560` gives the correct (i.e., English/ASCII) output. However, running `LANG=en hp-check -t` gives several "Gdk-WARNING **: locale not supported by C library" warnings and fails to detect cups (which is found correctly by `hp-check -t`).

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.