hplib (hp-sendfax) on Fedora 11 causes Stacktrace on UTF-8

Asked by M.Ende

If I try to send a fax (from openoffice) using the cups-printer and hp-sendfax I'll get this Stacktrace from hp-sendfax (same error occures when I'm using hp-toolbox). Printing and scanning is not affected.

I'm running Fedora 11 (LANG=de_DE.UTF-8 , x86_64)

[m.ende@server ~]$ LANG=C hp-sendfax -ldebug

HP Linux Imaging and Printing System (ver. 3.9.8)
PC Sendfax Utility ver. 9.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.

hp-sendfax[3504]: debug: getPrinterName(None, None, ['hpfax'], {'fax-type': (<built-in function gt>, 0)})
hp-sendfax[3504]: debug: Mode=1
hp-sendfax[3504]: debug: hp:/net/HP_LaserJet_3055?zc=HP3055: back_end:hp is_hp:True bus:net model:HP_LaserJet_3055 serial: dev_file: host:HP3055 zc:HP3055 port:1
hp-sendfax[3504]: debug: hpfax:/net/HP_LaserJet_3055?zc=HP3055: back_end:hpfax is_hp:True bus:net model:HP_LaserJet_3055 serial: dev_file: host:HP3055 zc:HP3055 port:1
hp-sendfax[3504]: debug: Cache miss: hp_laserjet_3055
hp-sendfax[3504]: debug: Reading file: /usr/share/hplip/data/models/models.dat
hp-sendfax[3504]: debug: Searching for section [hp_laserjet_3055] in file /usr/share/hplip/data/models/models.dat
hp-sendfax[3504]: debug: Found section [hp_laserjet_3055] in file /usr/share/hplip/data/models/models.dat
hp-sendfax[3504]: debug: [u'HP_LaserJet_3055_fax']
Using printer: HP_LaserJet_3055_fax

hp-sendfax[3504]: debug: hp:/net/HP_LaserJet_3055?zc=HP3055: back_end:hp is_hp:True bus:net model:HP_LaserJet_3055 serial: dev_file: host:HP3055 zc:HP3055 port:1
hp-sendfax[3504]: debug: hpfax:/net/HP_LaserJet_3055?zc=HP3055: back_end:hpfax is_hp:True bus:net model:HP_LaserJet_3055 serial: dev_file: host:HP3055 zc:HP3055 port:1
hp-sendfax[3504]: debug: Loading user settings...
hp-sendfax[3504]: debug: FAB command: /usr/bin/hp-fab
hp-sendfax[3504]: debug: Scan command: /usr/bin/xsane -V %SANE_URI%
hp-sendfax[3504]: debug: Auto refresh: False
hp-sendfax[3504]: debug: Auto refresh rate: 30
hp-sendfax[3504]: debug: Auto refresh type: 1
hp-sendfax[3504]: debug: Systray visible: 0
hp-sendfax[3504]: debug: Systray messages: 0
hp-sendfax[3504]: debug: Last used device URI: hpfax:/net/HP_LaserJet_3055?zc=HP3055
hp-sendfax[3504]: debug: Last used printer: HP_LaserJet_3055_fax
hp-sendfax[3504]: debug: Working directory: .
hp-sendfax[3504]: debug: Loading user settings...
hp-sendfax[3504]: debug: FAB command: /usr/bin/hp-fab
hp-sendfax[3504]: debug: Scan command: /usr/bin/xsane -V %SANE_URI%
hp-sendfax[3504]: debug: Auto refresh: False
hp-sendfax[3504]: debug: Auto refresh rate: 30
hp-sendfax[3504]: debug: Auto refresh type: 1
hp-sendfax[3504]: debug: Systray visible: 0
hp-sendfax[3504]: debug: Systray messages: 0
hp-sendfax[3504]: debug: Last used device URI: hpfax:/net/HP_LaserJet_3055?zc=HP3055
hp-sendfax[3504]: debug: Last used printer: HP_LaserJet_3055_fax
hp-sendfax[3504]: debug: Working directory: .
hp-sendfax[3504]: debug: Connecting to com.hplip.StatusService (try #1)...
hp-sendfax[3504]: debug: Running hp-systray: /usr/bin/hp-systray --force-startup
hp-sendfax[3504]: debug: Waiting for hp-systray to start...

HP Linux Imaging and Printing System (ver. 3.9.8)
System Tray Status Service ver. 2.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.

hp-sendfax[3504]: debug: Connecting to com.hplip.StatusService (try #2)...
hp-sendfax[3504]: debug: Connected.
hp-sendfax[3504]: debug: Loading user settings...
hp-sendfax[3504]: debug: FAB command: /usr/bin/hp-fab
hp-sendfax[3504]: debug: Scan command: /usr/bin/xsane -V %SANE_URI%
hp-sendfax[3504]: debug: Auto refresh: False
hp-sendfax[3504]: debug: Auto refresh rate: 30
hp-sendfax[3504]: debug: Auto refresh type: 1
hp-sendfax[3504]: debug: Systray visible: 0
hp-sendfax[3504]: debug: Systray messages: 0
hp-sendfax[3504]: debug: Last used device URI: hpfax:/net/HP_LaserJet_3055?zc=HP3055
hp-sendfax[3504]: debug: Last used printer: HP_LaserJet_3055_fax
hp-sendfax[3504]: debug: Working directory: .
hp-sendfax[3504]: debug: Starting GUI loop...
hp-sendfax[3504]: debug: Locking: /home/m.ende/.hplip/hp-sendfax-HP_LaserJet_3055_fax.lock
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 214, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/share/hplip/hpssd.py", line 498, in handle_system_signal
    return handle_signal('system', *args, **kwds)
  File "/usr/share/hplip/hpssd.py", line 494, in handle_signal
    return handle_event(event, args[6:])
  File "/usr/share/hplip/hpssd.py", line 407, in handle_event
    send_event_to_systray_ui(event)
  File "/usr/share/hplip/hpssd.py", line 465, in send_event_to_systray_ui
    e = event.copy()
  File "/usr/share/hplip/base/device.py", line 155, in copy
    return Event(*self.as_tuple())
  File "/usr/share/hplip/base/device.py", line 108, in __init__
    self.title = unicode(utils.xrstrip(title, '\x00'))[:64].encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 23: ordinal not in range(128)
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 214, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/share/hplip/hpssd.py", line 498, in handle_system_signal
    return handle_signal('system', *args, **kwds)
  File "/usr/share/hplip/hpssd.py", line 494, in handle_signal
    return handle_event(event, args[6:])
  File "/usr/share/hplip/hpssd.py", line 416, in handle_event
    handle_fax_event(event, pipe_name)
  File "/usr/share/hplip/hpssd.py", line 268, in handle_fax_event
    device.FaxEvent(fax_file_name, event)
  File "/usr/share/hplip/base/device.py", line 169, in __init__
    Event.__init__(self, *event.as_tuple())
  File "/usr/share/hplip/base/device.py", line 108, in __init__
    self.title = unicode(utils.xrstrip(title, '\x00'))[:64].encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 23: ordinal not in range(128)
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 214, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/share/hplip/hpssd.py", line 498, in handle_system_signal
    return handle_signal('system', *args, **kwds)
  File "/usr/share/hplip/hpssd.py", line 494, in handle_signal
    return handle_event(event, args[6:])
  File "/usr/share/hplip/hpssd.py", line 407, in handle_event
    send_event_to_systray_ui(event)
  File "/usr/share/hplip/hpssd.py", line 465, in send_event_to_systray_ui
    e = event.copy()
  File "/usr/share/hplip/base/device.py", line 155, in copy
    return Event(*self.as_tuple())
  File "/usr/share/hplip/base/device.py", line 108, in __init__
    self.title = unicode(utils.xrstrip(title, '\x00'))[:64].encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 23: ordinal not in range(128)
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 214, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/share/hplip/hpssd.py", line 498, in handle_system_signal
    return handle_signal('system', *args, **kwds)
  File "/usr/share/hplip/hpssd.py", line 494, in handle_signal
    return handle_event(event, args[6:])
  File "/usr/share/hplip/hpssd.py", line 407, in handle_event
    send_event_to_systray_ui(event)
  File "/usr/share/hplip/hpssd.py", line 465, in send_event_to_systray_ui
    e = event.copy()
  File "/usr/share/hplip/base/device.py", line 155, in copy
    return Event(*self.as_tuple())
  File "/usr/share/hplip/base/device.py", line 108, in __init__
    self.title = unicode(utils.xrstrip(title, '\x00'))[:64].encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 23: ordinal not in range(128)
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 214, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/share/hplip/hpssd.py", line 498, in handle_system_signal
    return handle_signal('system', *args, **kwds)
  File "/usr/share/hplip/hpssd.py", line 494, in handle_signal
    return handle_event(event, args[6:])
  File "/usr/share/hplip/hpssd.py", line 407, in handle_event
    send_event_to_systray_ui(event)
  File "/usr/share/hplip/hpssd.py", line 465, in send_event_to_systray_ui
    e = event.copy()
  File "/usr/share/hplip/base/device.py", line 155, in copy
    return Event(*self.as_tuple())
  File "/usr/share/hplip/base/device.py", line 108, in __init__
    self.title = unicode(utils.xrstrip(title, '\x00'))[:64].encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 23: ordinal not in range(128)

Question information

Language:
English Edit question
Status:
Solved
For:
HPLIP Edit question
Assignee:
No assignee Edit question
Solved by:
M.Ende
Solved:
Last query:
Last reply:
Revision history for this message
M.Ende (marc-ende) said :
#1

It's this line which causes the mentioned Error:

self.title = unicode(utils.xrstrip(title, '\x00'))[:64].encode('utf-8')

This occures when the title of the document contains non-ascii-characters (like üäöß..)
If you keep ascii-only everything works.

I'll file that as an issue

Revision history for this message
Ivan Ivanoff (spammeroff) said :
#2

Well, M.Ende. It does not help. At all. And how to UTF8ized this script? By the way I use Cyrillic.

Revision history for this message
M.Ende (marc-ende) said :
#3

Ivan,

I've tried several times around with the utf-8 conversation. After fixing the UTF-8 I had issues with the date,
which is processed near by this line. After spending much time in the UTF-8 problems I had decided not
to follow this issue anymore. Now I'm using ASCII-Only filenames. This way I'm around this issue.

After working on this, I had realized that UTF-8/Unicode/Ascii-transcodings and python aren't really good friends. :(